home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 278_01 / cxl.doc < prev    next >
Text File  |  1990-02-13  |  284KB  |  9,837 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.                                     C X L
  22.  
  23.                  The C Programmer's Extended Function Library
  24.  
  25.                                   Version 5.1
  26.  
  27.                                September 1, 1989
  28.  
  29.                                 by Mike Smedley
  30.  
  31.                  Copyright (c) 1987-1989  All Rights Reserved
  32.  
  33.                                Reference Manual
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.                               Table of Contents
  63.  
  64.                  Introduction................................1
  65.                       General Information....................1
  66.                       Features of the CXL Library............1
  67.                       Registration Information...............3
  68.                       How to Contact the Author..............6
  69.                       Disclaimer.............................6
  70.                       Trademarks.............................6
  71.                       Using CXL Functions....................7
  72.                  Global Variables............................8
  73.                       _kbinfo................................8
  74.                       _mouse.................................8
  75.                       _vinfo.................................8
  76.                       _winfo.................................9
  77.                  Library Functions..........................11
  78.                       attrib................................11
  79.                       beep..................................11
  80.                       biosver...............................11
  81.                       box_..................................12
  82.                       capsoff...............................12
  83.                       capson................................13
  84.                       cclrscrn..............................13
  85.                       cgardbyte.............................13
  86.                       cgardword.............................14
  87.                       cgareadn..............................14
  88.                       cgawrbyte.............................14
  89.                       cgawriten.............................15
  90.                       cgawrstr..............................15
  91.                       cgawrword.............................16
  92.                       chgonkey..............................16
  93.                       clearkeys.............................17
  94.                       clockcal..............................17
  95.                       clreol_...............................17
  96.                       clrscrn...............................18
  97.                       clrwin................................18
  98.                       cvaltype..............................18
  99.                       cvtcf.................................19
  100.                       cvtci.................................19
  101.                       cvtfc.................................20
  102.                       cvtic.................................20
  103.                       cxlver................................21
  104.                       delay_................................21
  105.                       disktoscrn............................21
  106.                       disktowin.............................22
  107.                       EMS Functions.........................23
  108.                       emsalloc..............................24
  109.                       emsdealloc............................24
  110.                       emsexist..............................25
  111.                       emsframe..............................25
  112.                       emsfree...............................25
  113.                       emsmap................................26
  114.                       emsread...............................26
  115.                       emstotal..............................27
  116.  
  117.  
  118.  
  119.                                       i
  120.  
  121.  
  122.                       emsver................................27
  123.                       emswrite..............................27
  124.                       expmem................................28
  125.                       extmem................................28
  126.                       fcrypt................................29
  127.                       fill_.................................29
  128.                       freonkey..............................30
  129.                       gameport..............................30
  130.                       getchf................................30
  131.                       getcursz..............................31
  132.                       getns.................................31
  133.                       getxch................................32
  134.                       gotoxy_...............................32
  135.                       hidecur...............................33
  136.                       inputsf...............................33
  137.                       kbclear...............................34
  138.                       kbmhit................................34
  139.                       kbput.................................34
  140.                       kbputs................................35
  141.                       kbstat................................36
  142.                       lcrlf.................................36
  143.                       lgcursor..............................36
  144.                       lprintc...............................37
  145.                       lprintf...............................37
  146.                       lprintns..............................38
  147.                       lprints...............................38
  148.                       lprintsb..............................38
  149.                       lprintsu..............................39
  150.                       machid................................39
  151.                       mapattr...............................40
  152.                       mathchip..............................40
  153.                       mode..................................40
  154.                       msbclear..............................41
  155.                       msbpress..............................41
  156.                       msbreles..............................42
  157.                       mscondoff.............................43
  158.                       mscursor..............................43
  159.                       msgotoxy..............................44
  160.                       mshbounds.............................44
  161.                       mshidecur.............................45
  162.                       msinit................................45
  163.                       msmotion..............................45
  164.                       msshowcur.............................46
  165.                       msspeed...............................46
  166.                       msstatus..............................46
  167.                       mssupport.............................47
  168.                       msvbounds.............................48
  169.                       numflop...............................48
  170.                       numoff................................48
  171.                       numon.................................49
  172.                       numpar................................49
  173.                       numser................................49
  174.                       printc................................50
  175.                       prints................................50
  176.  
  177.  
  178.  
  179.                                       ii
  180.  
  181.  
  182.                       putchat...............................51
  183.                       randfile..............................51
  184.                       readchat..............................51
  185.                       readcur...............................52
  186.                       revattr...............................52
  187.                       revsattr..............................53
  188.                       scancode..............................53
  189.                       scrndump..............................54
  190.                       scrntodisk............................54
  191.                       setattr...............................54
  192.                       setcursz..............................55
  193.                       setkbloop.............................55
  194.                       setlines..............................56
  195.                       setonkey..............................56
  196.                       setvparam.............................57
  197.                       showcur...............................57
  198.                       smcursor..............................58
  199.                       sound_................................58
  200.                       spc...................................58
  201.                       srestore..............................59
  202.                       ssave.................................59
  203.                       strblank..............................60
  204.                       strbmatch.............................60
  205.                       strbtrim..............................61
  206.                       strchg................................61
  207.                       strchksum.............................62
  208.                       strcode...............................62
  209.                       strdel................................63
  210.                       strdela...............................63
  211.                       strichg...............................64
  212.                       strichksum............................64
  213.                       stridel...............................65
  214.                       stridela..............................65
  215.                       striinc...............................66
  216.                       strinc................................66
  217.                       strins................................67
  218.                       striocc...............................67
  219.                       strischg..............................68
  220.                       strisocc..............................69
  221.                       strisrep..............................69
  222.                       strleft...............................70
  223.                       strljust..............................70
  224.                       strltrim..............................71
  225.                       strmatch..............................71
  226.                       strmid................................72
  227.                       strocc................................72
  228.                       strright..............................73
  229.                       strrjust..............................73
  230.                       strrol................................74
  231.                       strror................................74
  232.                       strschg...............................75
  233.                       strsetsz..............................75
  234.                       strshl................................76
  235.                       strshr................................77
  236.  
  237.  
  238.  
  239.                                      iii
  240.  
  241.  
  242.                       strsocc...............................77
  243.                       strsrep...............................78
  244.                       strtrim...............................78
  245.                       struplow..............................79
  246.                       sysdate...............................79
  247.                       systime...............................80
  248.                       tabstop...............................80
  249.                       timer.................................81
  250.                       touplow...............................81
  251.                       videoinit.............................82
  252.                       vidmode...............................82
  253.                       vidtype...............................83
  254.                       wactiv................................83
  255.                       waitkey...............................84
  256.                       waitkeyt..............................84
  257.                       wborder...............................85
  258.                       wbox..................................85
  259.                       wbprintc..............................86
  260.                       wcclear...............................86
  261.                       wcenters..............................87
  262.                       wchgattr..............................87
  263.                       wchkbox...............................88
  264.                       wchkcol...............................88
  265.                       wchkcoord.............................89
  266.                       wchkrow...............................89
  267.                       wclear................................90
  268.                       wclose................................90
  269.                       wcloseall.............................90
  270.                       wclreol...............................91
  271.                       wclreos...............................91
  272.                       wcopy.................................91
  273.                       wdelline..............................92
  274.                       wdrag.................................93
  275.                       wdump.................................93
  276.                       wdupc.................................93
  277.                       wdups.................................94
  278.                       werrmsg...............................95
  279.                       wfill.................................95
  280.                       wfillch...............................96
  281.                       wfindrec..............................96
  282.                       wgetc.................................96
  283.                       wgetchf...............................97
  284.                       wgetns................................97
  285.                       wgets.................................98
  286.                       wgetyn................................99
  287.                       wgotoxy...............................99
  288.                       whandle..............................100
  289.                       Context-Sensitive Help Functions.....100
  290.                       whelpcat.............................102
  291.                       whelpclr.............................103
  292.                       whelpdef.............................103
  293.                       whelpop..............................104
  294.                       whelpopc.............................104
  295.                       whelppcat............................105
  296.  
  297.  
  298.  
  299.                                       iv
  300.  
  301.  
  302.                       whelpush.............................105
  303.                       whelpushc............................105
  304.                       whelpundef...........................106
  305.                       whelpwin.............................106
  306.                       whide................................107
  307.                       whline...............................107
  308.                       windowat.............................108
  309.                       windump..............................109
  310.                       Multi-Field Input Functions..........109
  311.                       winpbeg..............................112
  312.                       winpdef..............................113
  313.                       winpfba..............................114
  314.                       winpfcurr............................114
  315.                       winpffind............................115
  316.                       winpkey..............................115
  317.                       winpread.............................116
  318.                       winputsf.............................117
  319.                       winsline.............................117
  320.                       wintodisk............................118
  321.                       wisactiv.............................118
  322.                       Bar Menu Functions...................119
  323.                       wmenubeg.............................120
  324.                       wmenubegc............................121
  325.                       wmenuend.............................122
  326.                       wmenuget.............................123
  327.                       wmenuiba.............................123
  328.                       wmenuicurr...........................124
  329.                       wmenuidsab...........................124
  330.                       wmenuienab...........................125
  331.                       wmenuifind...........................125
  332.                       wmenuinext...........................126
  333.                       wmenuitem............................126
  334.                       wmenuitxt............................128
  335.                       wmenumcurr...........................128
  336.                       wmessage.............................129
  337.                       wmove................................129
  338.                       wopen................................130
  339.                       wperror..............................131
  340.                       wpgotoxy.............................131
  341.                       wpickfile............................132
  342.                       wpickstr.............................133
  343.                       wprintc..............................134
  344.                       wprintf..............................134
  345.                       wprints..............................135
  346.                       wprintsf.............................135
  347.                       wputc................................136
  348.                       wputns...............................137
  349.                       wputs................................137
  350.                       wputsw...............................138
  351.                       wreadcur.............................138
  352.                       wrestore.............................139
  353.                       wrjusts..............................139
  354.                       wsave................................140
  355.                       wscanf...............................140
  356.  
  357.  
  358.  
  359.                                       v
  360.  
  361.  
  362.                       wscroll..............................141
  363.                       wscrollbox...........................141
  364.                       wselstr..............................142
  365.                       wsetesc..............................142
  366.                       wshadoff.............................143
  367.                       wshadow..............................143
  368.                       wsize................................144
  369.                       wslide...............................144
  370.                       wtabwidth............................145
  371.                       wtextattr............................145
  372.                       wtitle...............................146
  373.                       wunhide..............................146
  374.                       wunlink..............................147
  375.                       wvline...............................147
  376.                       wwprints.............................148
  377.                  Appendix A - Text Attribute Identifiers...150
  378.                  Appendix B - Keycode Table................151
  379.                  Appendix C - Window Output Escape Codes...153
  380.                  Appendix D - Format Control Characters....154
  381.                  Appendix E - Input Field Editing Keys.....157
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.  
  405.  
  406.  
  407.  
  408.  
  409.  
  410.  
  411.  
  412.  
  413.  
  414.  
  415.  
  416.  
  417.  
  418.  
  419.                                       vi
  420.  
  421.  
  422.  
  423.                                 Introduction
  424.  
  425.  
  426.     General Information.
  427.  
  428.     The CXL library is intended to be a supplement to your C compiler's
  429.     standard run-time library.  It contains over 260 multi-purpose functions
  430.     which provide a variety of capabilities.  It is available for several
  431.     popular C compilers including Microsoft C, QuickC, Turbo C, and Zortech
  432.     C/C++.  These routines were written in 99% highly-optimized C code
  433.     ensuring maximum program speed, minimum program size, easy modification,
  434.     and increased portability.  This release is an evaluation release
  435.     containing everything you need to write C programs using the small
  436.     memory model. The libraries for the other memory models are supplied
  437.     when you register.
  438.  
  439.  
  440.     Features of the CXL Library.
  441.  
  442.         o   Powerful windowing system.  Allows as many open windows as
  443.             memory permits.  Windows can be stacked, tiled, shadowed, moved,
  444.             resized, and changed in many other ways.  There is a whole
  445.             assortment of various input and output functions to interract
  446.             with windows.
  447.  
  448.         o   Multi-field formatted data entry.  You can create data entry
  449.             forms that consist of one or more input fields.  You have full
  450.             control over user input and can tie validation functions into
  451.             each input field.  Features alpha and numeric justification,
  452.             capitalization conversion, formatting characters, and a large
  453.             assortment of editing keys.
  454.  
  455.         o   Moving bar menus.  You can easily create pop-up, pull-down, and
  456.             Lotus-style menus, as well as any other custom menu that you can
  457.             define.  Features full mouse support, nonselectable items,
  458.             global hot keys, and more.
  459.  
  460.         o   Scrollable pick menus.  Allow you to pick one item from a list
  461.             of items.  Features full mouse support and scroll bars.  There
  462.             is also a dedicated file picker that uses this feature to let
  463.             you pick from a list of files, very similar to the way that the
  464.             Turbo C and QuickC environments' file pickers work.
  465.  
  466.         o   Context-sensitive help system.  Help files are indexed for
  467.             speed.  Help categories can be cross-referenced.  Help can be
  468.             applied at the global, window, menu item, and input field
  469.             levels.
  470.  
  471.         o   Several video output methods.  These include direct screen
  472.             writing, direct screen writing with CGA snow elimination, video
  473.             BIOS writing, and DESQview video buffer writing.  These will
  474.             allow you to be video compatible with virtually any video
  475.             adapter or multitasking environment.
  476.  
  477.  
  478.  
  479.                                       1
  480.  
  481.  
  482.         o   EGA 43 and VGA 50-line modes.  CXL provides functions to
  483.             directly change to and from these modes.  CXL's video functions
  484.             are also compatible with nonstandard modes such as 132x25 and
  485.             120x43.
  486.  
  487.         o   Extensive mouse support.  Mouse movements can be translated into
  488.             keypresses, and several CXL functions have a "point-and-shoot"
  489.             type of mouse support that utilizes a free-moving mouse cursor.
  490.             There are also several functions for directly manipulating
  491.             Microsoft-compatible mice.
  492.  
  493.         o   Keyboard management routines.  Allows you to tie keystrokes to
  494.             functions, stuff and clear the keyboard buffer, set and read the
  495.             keyboard shift/toggle keys, and specify a function to be called
  496.             while waiting for a keypress.
  497.  
  498.         o   Advanced string manipulation.  There are a host of string
  499.             manipulation functions that perform searching, replacing,
  500.             formatting, conversion, rotating, shifting, pattern matching,
  501.             encryption, and other string operations.
  502.  
  503.         o   Several other functions for expanded memory (EMS) usage, file
  504.             encryption, date and time formatting, equipment detection,
  505.             printing, sound, and more.
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.  
  537.  
  538.  
  539.                                       2
  540.  
  541.  
  542.     Registration Information.
  543.  
  544.     CXL is distributed as User-Supported software.  You are free to copy and
  545.     distribute this software freely, however, if you find it of use to you,
  546.     you are encouraged to register your copy.  Registering your copy of the
  547.     software helps the author continue to provide professional-quality
  548.     software at very reasonable prices.
  549.  
  550.     The Basic Registration is $35.00 and includes the full library source
  551.     code, one library disk of your choice, batch files to build and update
  552.     the libraries, royalty-free use of library functions, unlimited
  553.     technical support, and low-cost upgrades.  Library disks contain all
  554.     memory model libraries supported by your compiler.  They are available
  555.     for Microsoft C/QuickC, Turbo C, and Zortech C/C++.
  556.  
  557.     Since you will have the source code, you will be able to use it to build
  558.     any of the libraries for the supported compilers.  However, if you don't
  559.     want to hassle with building libraries, pre-compiled library disks are
  560.     available for an additional $5.00 each (one library disk is included in
  561.     the Basic Registration).
  562.  
  563.     All materials are shipped on 5.25-inch floppy diskettes, however, there
  564.     is a 3.5-inch floppy diskette service available for an additional $5.00.
  565.     This is a once-per-order charge that covers as many 3.5-inch floppy
  566.     disks as are needed to ship your order.
  567.  
  568.     Non-U.S. orders need to include $5.00 extra to cover additional shipping
  569.     and handling charges.  Checks and money orders must be drawn on a U.S.
  570.     bank.  Please send all payments payable in U.S. Dollars.
  571.  
  572.     Texas residents must add 8% for state sales tax.
  573.  
  574.     Print the registration form, REGISTER.DOC, or include on a piece of
  575.     paper your name, address, phone number, and brand of compiler, and send
  576.     it along with your payment to:
  577.  
  578.             Mike Smedley
  579.             P.O. Box 33603
  580.             San Antonio, TX 78265-3603
  581.  
  582.     If by chance, you don't have the REGISTER.DOC file, a copy of the
  583.     registration form is included on the next page.
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.                                       3
  600.  
  601.  
  602.                                CXL REGISTRATION FORM
  603.  
  604.         NAME:     ______________________________________________________
  605.  
  606.         COMPANY:  ______________________________________________________
  607.  
  608.         ADDRESS:  ______________________________________________________
  609.  
  610.                   ______________________________________________________
  611.  
  612.         CITY:     ______________________________________________________
  613.  
  614.         STATE:    ________________________  ZIP CODE:  _________________
  615.  
  616.         PHONE:    ______________________________________________________
  617.  
  618.         E-MAIL ADDRESS:  _______________________________________________
  619.  
  620.         WHERE DID YOU RECEIVE CXL?  ____________________________________
  621.  
  622.         ________________________________________________________________
  623.  
  624.         COMMENTS:  _____________________________________________________
  625.  
  626.         ________________________________________________________________
  627.  
  628.  
  629.         Basic Registration @ $35.00                          $__________
  630.             (Circle ONE library disk)
  631.  
  632.             Microsoft     Turbo      Zortech
  633.  
  634.         Additional Library Disks @ $5.00 Each                 __________
  635.             (Circle each ADDITIONAL library disk)
  636.  
  637.             Microsoft     Turbo      Zortech
  638.  
  639.         3.5-Inch Floppy Disk Service @ $5.00                  __________
  640.             (Covers entire order)
  641.  
  642.         Shipping outside U.S. @ $5.00                         __________
  643.             (Payments MUST be in U.S. Dollars/U.S. Bank)
  644.  
  645.                                                  SUBTOTAL:   $__________
  646.  
  647.         Texas Residents Add 8% State Sales Tax
  648.             $35 = $2.80 | $40 = $3.20 | $45 = $3.60           __________
  649.             $50 = $4.00 | $55 = $4.40 | $60 = $4.80
  650.  
  651.         5.1                                         TOTAL:   $__________
  652.  
  653.         Remit to:         Mike Smedley
  654.                           P.O. Box 33603
  655.                           San Antonio, TX 78265-3603
  656.  
  657.  
  658.  
  659.                                       4
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.  
  668.  
  669.  
  670.  
  671.  
  672.  
  673.  
  674.  
  675.  
  676.  
  677.  
  678.  
  679.  
  680.  
  681.  
  682.  
  683.  
  684.  
  685.  
  686.  
  687.  
  688.  
  689.  
  690.  
  691.  
  692.  
  693.  
  694.  
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.                                       5
  720.  
  721.  
  722.     How to Contact the Author.
  723.  
  724.     Primary:
  725.         CXL Tech Support BBS - (512) 590-0460  1200-14400 HST  8-N-1
  726.  
  727.     Alternate:
  728.         CompuServe   -  71331,2244
  729.         GEnie        -  M.SMEDLEY
  730.         U.S. Mail    -  Mike Smedley
  731.                         P.O. Box 33603
  732.                         San Antonio, TX 78265-3603
  733.  
  734.  
  735.     Disclaimer.
  736.  
  737.     The author, Mike Smedley, claims no responsibility for any damages
  738.     caused by the use or misuse of this product.  This product is
  739.     distributed "as is" with no warranty expressed or implied.  The author
  740.     will not be responsible for any losses incurred, either directly or
  741.     indirectly, by the use of this product.  Use this product entirely at
  742.     your own risk.  The author reserves the right to make modifications at
  743.     any time.  Prices are subject to change without notice.
  744.  
  745.  
  746.     Trademarks.
  747.  
  748.     CompuServe is a registered trademark of CompuServe Incorporated.
  749.     DESQview is a trademark of Quarterdeck Office Systems.
  750.     Epson is a registered trademark of Seiko Epson Corporation.
  751.     GEnie is a trademark of GE Information Services.
  752.     IBM is a registered trademark of International Business Machines.
  753.     LIM and EMS are trademarks of Lotus, Intel, and Microsoft Corporations.
  754.     Lotus is a registered trademark of Lotus Development Corporation.
  755.     Microsoft is a registered trademark of Microsoft Corporation.
  756.     Turbo C is a registered trademark of Borland International.
  757.     Zortech is a trademark of Zortech Inc.
  758.  
  759.  
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.                                       6
  780.  
  781.  
  782.     Using CXL Functions.
  783.  
  784.     For every CXL function you use, there should be a corresponding CXL
  785.     header file #included at the top of your program.  The CXL header files
  786.     should follow your standard compiler header files.  For example:
  787.  
  788.         #include    <dos.h>
  789.         #include    <stdio.h>
  790.         #include    "cxldef.h"
  791.         #include    "cxlwin.h"
  792.  
  793.     The basic command line compiler/linker commands to build your file
  794.     containing CXL functions are as follows:
  795.  
  796.         Microsoft C:
  797.  
  798.             cl myfile.c cxlmss.lib
  799.  
  800.         Quick C:
  801.  
  802.             qcl myfile.c cxlmss.lib
  803.  
  804.         Turbo C:
  805.  
  806.             tcc myfile.c cxltcs.lib
  807.  
  808.         Zortech C/C++:
  809.  
  810.             ztc myfile cxlzts.lib
  811.  
  812.  
  813.     To use CXL from the Turbo C integrated environment (TC.EXE), you need to
  814.     create a project file containing the name of the CXL library.   You can
  815.     call it MYFILE.PRJ and it can consist of just one line:
  816.  
  817.             myfile.c cxltcs.lib
  818.  
  819.     Then when you run TC.EXE, set the project file name to MYFILE.PRJ and
  820.     press the Make key.
  821.  
  822.  
  823.  
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.                                       7
  840.  
  841.  
  842.                                Global Variables
  843.  
  844.  
  845.     NAME
  846.         _kbinfo
  847.  
  848.     DESCRIPTION
  849.         A record which holds keyboard information.  The individual structure
  850.         elements are:
  851.             kbuf   - pointer to head record in key buffer.
  852.             onkey  - pointer to head record in onkey list.
  853.             kbloop - pointer to function to call while waiting for a
  854.                      keypress.  This variable should be set with the
  855.                      setkbloop() function.
  856.             inmenu - inmenu flag used internally by the menuing and picking
  857.                      functions to help control mouse support.
  858.             source - source of last keypress.  0=keyboard, 1=key buffer, and
  859.                      2=mouse key emulation.
  860.  
  861.     SYNOPSIS
  862.         #include "cxlkey.h"
  863.         struct _kbinfo_t _kbinfo;
  864.  
  865.     ------------------------------------------------------------------------
  866.  
  867.     NAME
  868.         _mouse
  869.  
  870.     DESCRIPTION
  871.         This variable is set by the msinit() and/or mssupport() function. It
  872.         contains MS_NONE by default.  If msinit() detects a mouse, it will
  873.         set _mouse to MS_KEYS.  Also see the function descriptions of
  874.         msinit() and mssupport().
  875.  
  876.     SYNOPSIS
  877.         #include "cxlmou.h"
  878.         int _mouse;
  879.  
  880.     ------------------------------------------------------------------------
  881.  
  882.     NAME
  883.         _vinfo
  884.  
  885.     DESCRIPTION
  886.         The video information record.  The videoinit() function is
  887.         responsible for setting most of the elements in this record. If you
  888.         don't call videoinit(), they will default to CGA settings.  If you
  889.         modify any of these, you must modify them AFTER the call to
  890.         videoinit().  The one exception is _vinfo.dvcheck which, if used,
  891.         must be set BEFORE the call to videoinit().  The setvparam()
  892.         function should be used where possible.  The individual structure
  893.         elements are:
  894.             videoseg - video buffer segment address.  Default is 0xb800.
  895.             adapter  - video adapter type.  Default is V_CGA.
  896.  
  897.  
  898.  
  899.                                       8
  900.  
  901.  
  902.             numrows  - number of displayed rows.  Default is 25.
  903.             numcols  - number of displayed columns.  Default is 80.
  904.             cheight  - character height in pixels.  Default is 8.
  905.             cwidth   - character width  in pixels. Default is 8.
  906.             mono     - is it a monochrome video adapter?  Default is 0.
  907.             mapattr  - map color attribs to monochrome attribs?  By default,
  908.                        if a monochrome video adapter is detected by
  909.                        videoinit(), then all color attributes will be mapped
  910.                        to monochrome equivalents.  To disable this automatic
  911.                        mapping, set _vinfo.mapattr=0;.  Default is 1.
  912.             cgasnow  - is CGA snow present?  To turn snow elimination on,
  913.                        set _vinfo.cgasnow=1; and _vinfo.usebios=0;.  Default
  914.                        is 0.
  915.             usebios  - use BIOS for video writes?  To use BIOS for video
  916.                        writes, set _vinfo.usebios=1; and _vinfo.cgasnow=0;.
  917.                        Default is 0.
  918.             dvcheck  - check for DESQview?  To disable videoinit() from
  919.                        checking for DESQview, set _vinfo.dvcheck=0; before
  920.                        calling videoinit().  Default is 1.
  921.             dvexist  - is DESQview present?  Default is 0.
  922.  
  923.     SYNOPSIS
  924.         #include "cxlvid.h"
  925.         struct _vinfo_t _vinfo;
  926.  
  927.     ------------------------------------------------------------------------
  928.  
  929.     NAME
  930.         _winfo
  931.  
  932.     DESCRIPTION
  933.         The window information record.  The individual structure elements
  934.         are:
  935.             active   - pointer to active window's record.
  936.             hidden   - pointer to head hidden window's record.
  937.             menu     - pointer to head menu's record.
  938.             cmenu    - pointer to current menu's record.
  939.             helptr   - pointer to help information record.
  940.             handle   - last handle given to a window.  Every time wopen()
  941.                        creates a new window, it increments this value.
  942.             maxfiles - maximum number of files that can be displayed by
  943.                        wpickfile().  Default is 500.
  944.             help     - current help category number.
  945.             errno    - error number from last windowing function.  Most
  946.                        windowing functions set this variable before
  947.                        returning.  The werrmsg() function returns a literal
  948.                        representation of this value.
  949.             total    - total number of open windows.
  950.             mlevel   - system variable used by menu functions.
  951.             ilevel   - system variable used by menu functions.
  952.             esc      - check for [Esc] in input funcions? You should use the
  953.                        wsetesc() function to set this value.  Default is 1
  954.                        (yes).
  955.             tabwidth - window TTY output tab width.  You can use wtabwidth()
  956.  
  957.  
  958.  
  959.                                       9
  960.  
  961.  
  962.                        to set this value.  Default is 8.
  963.             fillch   - character to fill windows with.  You should use
  964.                        wfillch() to set this value.  Default is ' '.
  965.  
  966.     SYNOPSIS
  967.         #include "cxlwin.h"
  968.         struct _winfo_t _winfo;
  969.  
  970.  
  971.  
  972.  
  973.  
  974.  
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.  
  998.  
  999.  
  1000.  
  1001.  
  1002.  
  1003.  
  1004.  
  1005.  
  1006.  
  1007.  
  1008.  
  1009.  
  1010.  
  1011.  
  1012.  
  1013.  
  1014.  
  1015.  
  1016.  
  1017.  
  1018.  
  1019.                                       10
  1020.  
  1021.  
  1022.                               Library Functions
  1023.  
  1024.  
  1025.     NAME
  1026.         attrib
  1027.  
  1028.     DESCRIPTION
  1029.         Creates a text attribute.  It is usually much easier to create a
  1030.         text attribute using the attribute identifiers listed in Appendix A,
  1031.         but this provides an alternate method.
  1032.  
  1033.     SYNOPSIS
  1034.         #include "cxlvid.h"
  1035.         int attrib(int fore,int back,int bright,int blink);
  1036.  
  1037.     INPUTS
  1038.         fore   - foreground color code (0-7)
  1039.         back   - background color code (0-7)
  1040.         bright - intensity (0-1)
  1041.         blink  - blinking (0-1)
  1042.  
  1043.     RETURN VALUE
  1044.         The new attribute code.
  1045.  
  1046.     ALSO SEE
  1047.         setattr  wtextattr
  1048.  
  1049.     EXAMPLE
  1050.         prints(10,5,attrib(6,0,1,1),"Hello, world");
  1051.  
  1052.     ------------------------------------------------------------------------
  1053.  
  1054.     NAME
  1055.         beep
  1056.  
  1057.     DESCRIPTION
  1058.         Sounds a beep in the speaker.
  1059.  
  1060.     SYNOPSIS
  1061.         #include "cxldef.h"
  1062.         void beep(void);
  1063.  
  1064.     ALSO SEE
  1065.         sound_
  1066.  
  1067.     ------------------------------------------------------------------------
  1068.  
  1069.     NAME
  1070.         biosver
  1071.  
  1072.     DESCRIPTION
  1073.         Returns the ROM BIOS version date.
  1074.  
  1075.     SYNOPSIS
  1076.  
  1077.  
  1078.  
  1079.                                       11
  1080.  
  1081.  
  1082.         #include "cxldef.h"
  1083.         char *biosver(void);
  1084.  
  1085.     RETURN VALUE
  1086.         The address of the static string containing the ROM BIOS version
  1087.         date.
  1088.  
  1089.     ALSO SEE
  1090.         machid
  1091.  
  1092.     ------------------------------------------------------------------------
  1093.  
  1094.     NAME
  1095.         box_
  1096.  
  1097.     DESCRIPTION
  1098.         "Draws" a text box on the screen.
  1099.  
  1100.     SYNOPSIS
  1101.         #include "cxlvid.h"
  1102.         void box_(int srow,int scol,int erow,int ecol,int btype,int attr);
  1103.  
  1104.     INPUTS
  1105.         srow  - start row of box
  1106.         scol  - start column of box
  1107.         erow  - end row of box
  1108.         ecol  - end column of box
  1109.         btype - box type.  Can be one of the following:
  1110.                     0 - single line
  1111.                     1 - double line
  1112.                     2 - single horz, double vert line
  1113.                     3 - double horz, single vert line
  1114.                     4 - thick line
  1115.                     5 - no border (uses spaces for box chars)
  1116.         attr  - text attribute for border characters
  1117.  
  1118.     ALSO SEE
  1119.         fill_
  1120.  
  1121.     EXAMPLE
  1122.         box_(10,10,20,40,2,YELLOW|_BLACK);
  1123.  
  1124.     ------------------------------------------------------------------------
  1125.  
  1126.     NAME
  1127.         capsoff
  1128.  
  1129.     DESCRIPTION
  1130.         Toggles the CapsLock key off.
  1131.  
  1132.     SYNOPSIS
  1133.         #include "cxlkey.h"
  1134.         void capsoff(void);
  1135.  
  1136.  
  1137.  
  1138.  
  1139.                                       12
  1140.  
  1141.  
  1142.     ALSO SEE
  1143.         capson  kbstat  numoff  numon
  1144.  
  1145.     ------------------------------------------------------------------------
  1146.  
  1147.     NAME
  1148.         capson
  1149.  
  1150.     DESCRIPTION
  1151.         Toggles the CapsLock key on.
  1152.  
  1153.     SYNOPSIS
  1154.         #include "cxlkey.h"
  1155.         void capson(void);
  1156.  
  1157.     ALSO SEE
  1158.         capsoff  kbstat  numoff  numon
  1159.  
  1160.     ------------------------------------------------------------------------
  1161.  
  1162.     NAME
  1163.         cclrscrn
  1164.  
  1165.     DESCRIPTION
  1166.         Clears the screen using given text attribute and homes the cursor.
  1167.  
  1168.     SYNOPSIS
  1169.         #include "cxlvid.h"
  1170.         void cclrscrn(int attr);
  1171.  
  1172.     INPUTS
  1173.         attr - text attribute to use to clear the screen with
  1174.  
  1175.     ALSO SEE
  1176.         clreol_  clrscrn  clrwin
  1177.  
  1178.     EXAMPLE
  1179.         cclrscrn(BLACK|_BLACK);
  1180.  
  1181.     ------------------------------------------------------------------------
  1182.  
  1183.     NAME
  1184.         cgardbyte
  1185.  
  1186.     DESCRIPTION
  1187.         Reads a byte from CGA video memory without snow.
  1188.  
  1189.     SYNOPSIS
  1190.         #include "cxlvid.h"
  1191.         int cgardbyte(char far *src);
  1192.  
  1193.     INPUTS
  1194.         src - far address to CGA video memory to read.
  1195.  
  1196.  
  1197.  
  1198.  
  1199.                                       13
  1200.  
  1201.  
  1202.     RETURN VALUE
  1203.         The byte read.
  1204.  
  1205.     ALSO SEE
  1206.         cgardword  cgareadn  cgawrbyte  cgawriten  cgawrstr  cgawrword
  1207.  
  1208.     ------------------------------------------------------------------------
  1209.  
  1210.     NAME
  1211.         cgardword
  1212.  
  1213.     DESCRIPTION
  1214.         Reads a word from CGA video memory without snow.
  1215.  
  1216.     SYNOPSIS
  1217.         #include "cxlvid.h"
  1218.         int cgardword(int far *src);
  1219.  
  1220.     INPUTS
  1221.         src - far address to CGA video memory to read.
  1222.  
  1223.     RETURN VALUE
  1224.         The word read.
  1225.  
  1226.     ALSO SEE
  1227.         cgardbyte  cgareadn  cgawrbyte  cgawriten  cgawrstr  cgawrword
  1228.  
  1229.     ------------------------------------------------------------------------
  1230.  
  1231.     NAME
  1232.         cgareadn
  1233.  
  1234.     DESCRIPTION
  1235.         Reads n words from CGA video memory without snow.
  1236.  
  1237.     SYNOPSIS
  1238.         #include "cxlvid.h"
  1239.         void cgareadn(int far *src,int *dest,unsigned n);
  1240.  
  1241.     INPUTS
  1242.         src  - far address to CGA video memory to read.
  1243.         dest - address of buffer where words will be copied to.
  1244.         n    - number of words to read.
  1245.  
  1246.     ALSO SEE
  1247.         cgardbyte  cgardword  cgawrbyte  cgawriten  cgawrstr  cgawrword
  1248.  
  1249.     ------------------------------------------------------------------------
  1250.  
  1251.     NAME
  1252.         cgawrbyte
  1253.  
  1254.     DESCRIPTION
  1255.         Writes a byte to CGA video memory without snow.
  1256.  
  1257.  
  1258.  
  1259.                                       14
  1260.  
  1261.  
  1262.     SYNOPSIS
  1263.         #include "cxlvid.h"
  1264.         void cgawrbyte(char far *dest,int chr);
  1265.  
  1266.     INPUTS
  1267.         dest - far address to CGA video memory to write to.
  1268.         chr  - the byte to write
  1269.  
  1270.     ALSO SEE
  1271.         cgardbyte  cgardword  cgareadn  cgawriten  cgawrstr  cgawrword
  1272.  
  1273.     ------------------------------------------------------------------------
  1274.  
  1275.     NAME
  1276.         cgawriten
  1277.  
  1278.     DESCRIPTION
  1279.         Writes n words to CGA video memory without snow.
  1280.  
  1281.     SYNOPSIS
  1282.         #include "cxlvid.h"
  1283.         void cgawriten(int *src,int far *dest,unsigned n);
  1284.  
  1285.     INPUTS
  1286.         src  - address of source buffer from which words will be read.
  1287.         dest - far address to CGA video memory to write to.
  1288.         n    - number of words to write.
  1289.  
  1290.     ALSO SEE
  1291.         cgardbyte  cgardword  cgareadn  cgawrbyte  cgawrstr  cgawrword
  1292.  
  1293.     ------------------------------------------------------------------------
  1294.  
  1295.     NAME
  1296.         cgawrstr
  1297.  
  1298.     DESCRIPTION
  1299.         Writes a string to CGA video memory without snow.
  1300.  
  1301.     SYNOPSIS
  1302.         #include "cxlvid.h"
  1303.         void cgawrstr(char far *dest,char *string,int attr);
  1304.  
  1305.     INPUTS
  1306.         dest   - far address to CGA video memory to write to.
  1307.         string - address of the string to be written.
  1308.         attr   - text attribute to be used for characters in string.
  1309.  
  1310.     ALSO SEE
  1311.         cgardbyte  cgardword  cgareadn  cgawrbyte  cgawriten  cgawrword
  1312.  
  1313.     ------------------------------------------------------------------------
  1314.  
  1315.     NAME
  1316.  
  1317.  
  1318.  
  1319.                                       15
  1320.  
  1321.  
  1322.         cgawrword
  1323.  
  1324.     DESCRIPTION
  1325.         Writes a word to CGA video memory without snow.
  1326.  
  1327.     SYNOPSIS
  1328.         #include "cxlvid.h"
  1329.         void cgawrword(int far *dest,int chratr);
  1330.  
  1331.     INPUTS
  1332.         dest - far address to CGA video memory to write to.
  1333.         chratr - word to be written in the form ((attr<<8)|ch).
  1334.  
  1335.     ALSO SEE
  1336.         cgardbyte  cgardword  cgareadn  cgawrbyte  cgawriten  cgawrstr
  1337.  
  1338.     ------------------------------------------------------------------------
  1339.  
  1340.     NAME
  1341.         chgonkey
  1342.  
  1343.     DESCRIPTION
  1344.         The setonkey() function builds a linked list in memory that contains
  1345.         each defined onkey.  This function, chgonkey(), allows you to
  1346.         maintain individual setonkey() lists and change back and forth
  1347.         between them.  You *could* use several setonkey() calls to define
  1348.         and un-define keys where appropriate, but you would find that it is
  1349.         a lot of trouble.  chgonkey() provides painless switching between
  1350.         onkey lists.
  1351.  
  1352.     SYNOPSIS
  1353.         #include "cxlkey.h"
  1354.         struct _onkey_t *chgonkey(struct _onkey_t *kblist);
  1355.  
  1356.     INPUTS
  1357.         The address of the onkey list to change to.  If you specify NULL,
  1358.         then no onkeys will be visible.
  1359.  
  1360.     RETURN VALUE
  1361.         The address of the previous onkey list.  Often you will want to save
  1362.         this address so that you can restore it later.
  1363.  
  1364.     ALSO SEE
  1365.         freonkey  setonkey
  1366.  
  1367.     EXAMPLE
  1368.         struct _onkey_t *k1,*k2;
  1369.         setonkey(0x2100,do_alt_f,0);
  1370.             /* [Alt-F] is defined */
  1371.         setonkey(0x2300,do_alt_f,0);
  1372.             /* [Alt-H] is defined */
  1373.         k1=chgonkey(NULL);
  1374.             /* [Alt-F] and [Alt-H] are disabled */
  1375.         setonkey(0x1205,do_ctrl_e,0);
  1376.  
  1377.  
  1378.  
  1379.                                       16
  1380.  
  1381.  
  1382.             /* [Ctrl-E] is defined */
  1383.         k2=chgonkey(k1);
  1384.             /* [Ctrl-E] is disabled, [Alt-F] and [Alt-H] are reenabled */
  1385.         freonkey();
  1386.             /* [Alt-F] and [Alt-H] are disabled and freed from memory */
  1387.         chgonkey(k2);
  1388.             /* [Ctrl-E] is reenabled */
  1389.  
  1390.     ------------------------------------------------------------------------
  1391.  
  1392.     NAME
  1393.         clearkeys
  1394.  
  1395.     DESCRIPTION
  1396.         Clears the keyboard buffer.
  1397.  
  1398.     SYNOPSIS
  1399.         #include <conio.h>
  1400.         #include "cxlkey.h"
  1401.         void clearkeys(void);
  1402.  
  1403.     ALSO SEE
  1404.         kbclear  waitkey
  1405.  
  1406.     ------------------------------------------------------------------------
  1407.  
  1408.     NAME
  1409.         clockcal
  1410.  
  1411.     DESCRIPTION
  1412.         Determines if a clock-calendar board is installed.  This usually
  1413.         will only work with the clock-calendar boards in XT-style machines.
  1414.  
  1415.     SYNOPSIS
  1416.         #include "cxldef.h"
  1417.         int clockcal(void);
  1418.  
  1419.     RETURN VALUE
  1420.         Nonzero if a clock-calendar board is present.
  1421.  
  1422.     ------------------------------------------------------------------------
  1423.  
  1424.     NAME
  1425.         clreol_
  1426.  
  1427.     DESCRIPTION
  1428.         Clears to the end of line using the text attribute under the cursor.
  1429.  
  1430.     SYNOPSIS
  1431.         #include "cxlvid.h"
  1432.         void clreol_(void);
  1433.  
  1434.     ALSO SEE
  1435.         cclrscrn  clrscrn  clrwin
  1436.  
  1437.  
  1438.  
  1439.                                       17
  1440.  
  1441.  
  1442.     ------------------------------------------------------------------------
  1443.  
  1444.     NAME
  1445.         clrscrn
  1446.  
  1447.     DESCRIPTION
  1448.         Clears the screen using the text attribute under the cursor, and
  1449.         homes the cursor.
  1450.  
  1451.     SYNOPSIS
  1452.         #include "cxlvid.h"
  1453.         void clrscrn(void);
  1454.  
  1455.     ALSO SEE
  1456.         cclrscrn  clreol_  clrwin
  1457.  
  1458.     ------------------------------------------------------------------------
  1459.  
  1460.     NAME
  1461.         clrwin
  1462.  
  1463.     DESCRIPTION
  1464.         Clears a window of the screen using the text attribute under the
  1465.         cursor.
  1466.  
  1467.     SYNOPSIS
  1468.         #include "cxlvid.h"
  1469.         void clrwin(int srow,int scol,int erow,int ecol);
  1470.  
  1471.     INPUTS
  1472.         srow - start row of window
  1473.         scol - start column of window
  1474.         erow - end row of window
  1475.         ecol - end column of window
  1476.  
  1477.     ALSO SEE
  1478.         cclrscrn  clreol_  clrscrn
  1479.  
  1480.     ------------------------------------------------------------------------
  1481.  
  1482.     NAME
  1483.         cvaltype
  1484.  
  1485.     DESCRIPTION
  1486.         Checks given character against a given CXL character type code, and
  1487.         determines if that character is valid for that type.  This function
  1488.         is used internally by several CXL functions.
  1489.  
  1490.     SYNOPSIS
  1491.         #include "cxlstr.h"
  1492.         int cvaltype(int ch,int ctype);
  1493.  
  1494.     INPUTS
  1495.         ch    - character to test
  1496.  
  1497.  
  1498.  
  1499.                                       18
  1500.  
  1501.  
  1502.         ctype - character type code to compare with.  See section on CXL
  1503.                 format strings for a list of valid character type codes.
  1504.                 See Appendix D for a list of character type codes which can
  1505.                 be used.
  1506.  
  1507.     RETURN VALUE
  1508.         -1 - invalid ctype was given
  1509.         0  - character is not valid for given ctype
  1510.         1  - character is valid for given ctype
  1511.  
  1512.     EXAMPLE
  1513.         printf("'A' is %sa valid character of type '#'\n",cvaltype('A','#')?
  1514.                "":"not ");
  1515.         printf("'7' is %sa valid character of type '#'\n",cvaltype('7','#')?
  1516.                "":"not ");
  1517.  
  1518.     ------------------------------------------------------------------------
  1519.  
  1520.     NAME
  1521.         cvtcf
  1522.  
  1523.     DESCRIPTION
  1524.         Converts a CXL field string to a floating point number.
  1525.  
  1526.     SYNOPSIS
  1527.         #include "cxlstr.h"
  1528.         double cvtcf(char *field,int wholesize,int fracsize);
  1529.  
  1530.     INPUTS
  1531.         field     - address of CXL field string
  1532.         wholesize - number of whole digits
  1533.         fracsize  - number of fractional digits
  1534.  
  1535.     RETURN VALUE
  1536.         A double precision floating point number.
  1537.  
  1538.     ALSO SEE
  1539.         cvtci  cvtfc  cvtic
  1540.  
  1541.     EXAMPLE
  1542.         double pi;
  1543.         pi=cvtcf("314159",1,5);
  1544.         printf("pi = %f\n",pi);
  1545.  
  1546.     ------------------------------------------------------------------------
  1547.  
  1548.     NAME
  1549.         cvtci
  1550.  
  1551.     DESCRIPTION
  1552.         Converts a CXL field string to an integer.
  1553.  
  1554.     SYNOPSIS
  1555.         #include "cxlstr.h"
  1556.  
  1557.  
  1558.  
  1559.                                       19
  1560.  
  1561.  
  1562.         int cvtci(char *field);
  1563.  
  1564.     INPUTS
  1565.         field - address of CXL field string
  1566.  
  1567.     RETURN VALUE
  1568.         An integer number.
  1569.  
  1570.     ALSO SEE
  1571.         cvtcf  cvtfc  cvtic
  1572.  
  1573.     EXAMPLE
  1574.         int i;
  1575.         i=cvtci("32767");
  1576.         printf("i = %d\n",i);
  1577.  
  1578.     ------------------------------------------------------------------------
  1579.  
  1580.     NAME
  1581.         cvtfc
  1582.  
  1583.     DESCRIPTION
  1584.         Converts a floating point number to a CXL field string.
  1585.  
  1586.     SYNOPSIS
  1587.         #include "cxlstr.h"
  1588.         void cvtfc(char *field,double value,int wholesize,int fracsize);
  1589.  
  1590.     INPUTS
  1591.         field     - address of buffer to receive field string
  1592.         value     - floating point number to convert
  1593.         wholesize - number of whole digits
  1594.         fracsize  - number of fractional digits
  1595.  
  1596.     ALSO SEE
  1597.         cvtcf  cvtci  cvtic
  1598.  
  1599.     EXAMPLE
  1600.         char field[8];
  1601.         cvtfc(field,3.14159,2,4);
  1602.         printf("field = '%s'\n",field);
  1603.  
  1604.     ------------------------------------------------------------------------
  1605.  
  1606.     NAME
  1607.         cvtic
  1608.  
  1609.     DESCRIPTION
  1610.         Converts an integer to a CXL field string.
  1611.  
  1612.     SYNOPSIS
  1613.         #include "cxlstr.h"
  1614.         void cvtic(char *field,int value,int size);
  1615.  
  1616.  
  1617.  
  1618.  
  1619.                                       20
  1620.  
  1621.  
  1622.     INPUTS
  1623.         field - address of buffer to receive CXL field string
  1624.         value - integer value to convert
  1625.         size  - field size
  1626.  
  1627.     ALSO SEE
  1628.         cvtcf  cvtci  cvtfc
  1629.  
  1630.     EXAMPLE
  1631.         char field[8];
  1632.         cvtic(field,27,5);
  1633.         printf("field = '%s'\n",field);
  1634.  
  1635.     ------------------------------------------------------------------------
  1636.  
  1637.     NAME
  1638.         cxlver
  1639.  
  1640.     DESCRIPTION
  1641.         Returns the CXL version number of the current CXL library in use.
  1642.  
  1643.     SYNOPSIS
  1644.         #include "cxldef.h"
  1645.         char *cxlver(void);
  1646.  
  1647.     RETURN VALUE
  1648.         The address of the static string containing the CXL version number.
  1649.  
  1650.     ------------------------------------------------------------------------
  1651.  
  1652.     NAME
  1653.         delay_
  1654.  
  1655.     DESCRIPTION
  1656.         Delays program execution for a specified duration.
  1657.  
  1658.     SYNOPSIS
  1659.         #include "cxldef.h"
  1660.         void delay_(unsigned duration);
  1661.  
  1662.     INPUTS
  1663.         duration - duration of delay (0-65535) ie. 182 = 10 seconds
  1664.  
  1665.     ALSO SEE
  1666.         timer  waitkeyt
  1667.  
  1668.     EXAMPLE
  1669.         delay_(36);     /* pause for 2 seconds */
  1670.  
  1671.     ------------------------------------------------------------------------
  1672.  
  1673.     NAME
  1674.         disktoscrn
  1675.  
  1676.  
  1677.  
  1678.  
  1679.                                       21
  1680.  
  1681.  
  1682.     DESCRIPTION
  1683.         Copies a previously saved screen disk file to the screen.
  1684.  
  1685.     SYNOPSIS
  1686.         #include "cxlvid.h"
  1687.         int disktoscrn(char *fname);
  1688.  
  1689.     INPUTS
  1690.         fname - address of the string containing file name to read from.
  1691.  
  1692.     RETURN VALUE
  1693.         Nonzero if an error occurred.
  1694.  
  1695.     ALSO SEE
  1696.         disktowin  scrntodisk  wintodisk
  1697.  
  1698.     EXAMPLE
  1699.         char fname[]="SCRN.DAT";
  1700.         if(disktoscrn(fname)) {
  1701.             printf("Error reading file:  %s\n",fname);
  1702.             exit(1);
  1703.         }
  1704.  
  1705.     ------------------------------------------------------------------------
  1706.  
  1707.     NAME
  1708.         disktowin
  1709.  
  1710.     DESCRIPTION
  1711.         Copies a previously saved window disk file to the screen.
  1712.  
  1713.     SYNOPSIS
  1714.         #include "cxlvid.h"
  1715.         int disktowin(char *fname);
  1716.  
  1717.     INPUTS
  1718.         fname - address of the string containing file name of file to read
  1719.                 from.
  1720.  
  1721.     RETURN VALUE
  1722.         Nonzero if an error occurred.
  1723.  
  1724.     ALSO SEE
  1725.         disktoscrn  scrntodisk  wintodisk
  1726.  
  1727.     EXAMPLE
  1728.         char fname[]="WIND.DAT";
  1729.         if(disktowin(fname)) {
  1730.             printf("Error reading file:  %s\n",fname);
  1731.             exit(1);
  1732.         }
  1733.  
  1734.     ------------------------------------------------------------------------
  1735.  
  1736.  
  1737.  
  1738.  
  1739.                                       22
  1740.  
  1741.  
  1742.     EMS Functions
  1743.  
  1744.     CXL contains several functions for simple management of expanded
  1745.     memory. All of CXL's EMS functions are prefixed with 'ems'.  For those
  1746.     not familiar with expanded memory, here is a brief explanation.
  1747.  
  1748.     The 8088 microprocessor is only able to address 1 Megabyte of memory.
  1749.     When applications started needing more memory, Lotus, Intel, and
  1750.     Microsoft developed the Expanded Memory Specification.  This
  1751.     specification allows access to more than 1 Megabyte of memory by mapping
  1752.     16K 'windows' of memory on an expanded memory board in and out of an
  1753.     unused area of DOS memory.  The Expanded Memory Manager (EMM) is a
  1754.     software driver that controls the mapping.
  1755.  
  1756.     Physical pages are 16K blocks of memory which are located in an unused
  1757.     area of DOS memory.  There are typically 4 physical pages comprising a
  1758.     64K contiguous area of mappable DOS memory.  The EMS page frame base
  1759.     address points to the beginning of the first physical page.  Logical
  1760.     pages are 16K blocks of memory on the expanded memory board.  There can
  1761.     be as many logical pages as the expanded memory board has, up to 8
  1762.     Megabytes.
  1763.  
  1764.     Every program that uses expanded memory must do the following:
  1765.  
  1766.         1.  determine if the EMM device driver is loaded
  1767.         2.  determine if there are enough free pages for its application
  1768.         3.  allocate pages of expanded memory
  1769.         4.  find out what the EMS page frame base address is
  1770.         5.  map logical pages onto physical pages
  1771.         6.  deallocate pages when finished with them
  1772.  
  1773.     Here's an example of using CXL's EMS functions to perform these
  1774.     procedures:
  1775.  
  1776.         int handle1,handle2;
  1777.         char buf[14];
  1778.         if(!emsexist()) {                /*  Check for the EMM driver.    */
  1779.             printf("EMM not loaded\n");
  1780.             exit(1);
  1781.         }
  1782.         handle1=emsalloc(2);             /*  Request 2 pages of EMS       */
  1783.                                          /*  memory.                      */
  1784.         handle2=emsalloc(2);             /*  Request 2 more pages.        */
  1785.         if(handle1==-1 || handle2==-1) { /*  Test for allocation error.   */
  1786.             printf("EMS allocation error\n");
  1787.             exit(1);
  1788.         }
  1789.         emsmap(handle1,0,0);             /*  Map logical page 0 of handle */
  1790.                                          /*  1 to physical page 0.        */
  1791.         emswrite("Hello, world",0,13);   /*  Write a string at offset 0,  */
  1792.                                          /*  automatically determines what*/
  1793.                                          /*  the page frame address is.   */
  1794.         emsmap(handle2,0,0);             /*  Map logical page 0 of handle */
  1795.                                          /*  2 to physical page 0.        */
  1796.  
  1797.  
  1798.  
  1799.                                       23
  1800.  
  1801.  
  1802.         emswrite("How are you?",0,13);   /*  Write a string at offset 0.  */
  1803.         emsmap(handle1,0,0);             /*  Map logical page 0 of handle */
  1804.                                          /*  1 to physical page 0.        */
  1805.         emsread(buf,0,13);               /*  Read 13 bytes from offset 0  */
  1806.                                          /*  into buffer.                 */
  1807.         printf("buf = %s\n",buf);        /*  Display buffer contents.     */
  1808.         emsmap(handle2,0,0);             /*  Map logical page 0 of handle */
  1809.                                          /*  2 to physical page 0.        */
  1810.         emsread(buf,0,13);               /*  Read 13 bytes from offset 0  */
  1811.                                          /*  into buffer.                 */
  1812.         printf("buf = %s\n",buf);        /*  Display buffer contents.     */
  1813.         emsdealloc(handle2);             /*  Deallocate pages belonging   */
  1814.                                          /*  to handle 2.                 */
  1815.         emsdealloc(handle1);             /*  Deallocate pages belonging   */
  1816.                                          /*  to handle 1.                 */
  1817.  
  1818.     ------------------------------------------------------------------------
  1819.  
  1820.     NAME
  1821.         emsalloc
  1822.  
  1823.     DESCRIPTION
  1824.         Allocates pages of EMS memory.
  1825.  
  1826.     SYNOPSIS
  1827.         #include "cxlems.h"
  1828.         int emsalloc(int numpages);
  1829.  
  1830.     INPUTS
  1831.         numpages - the number of pages (16K blocks) of memory requested.
  1832.                    For example, to allocate 512K of EMS memory, you would
  1833.                    request 512/16, or 32 pages.
  1834.  
  1835.     RETURN VALUE
  1836.         The EMS handle assigned to the allocated block of memory, or -1 if
  1837.         an error occurred.
  1838.  
  1839.     ALSO SEE
  1840.         emsdealloc  emsexist  emsfree
  1841.  
  1842.     ------------------------------------------------------------------------
  1843.  
  1844.     NAME
  1845.         emsdealloc
  1846.  
  1847.     DESCRIPTION
  1848.         Deallocates previously allocated pages of EMS memory.
  1849.  
  1850.     SYNOPSIS
  1851.         #include "cxlems.h"
  1852.         int emsdealloc(int handle);
  1853.  
  1854.     INPUTS
  1855.         handle - the EMS handle of the allocated EMS memory to deallocate
  1856.  
  1857.  
  1858.  
  1859.                                       24
  1860.  
  1861.  
  1862.     RETURN VALUE
  1863.         Nonzero if an error occurred.
  1864.  
  1865.     ALSO SEE
  1866.         emsalloc  emsexist
  1867.  
  1868.     ------------------------------------------------------------------------
  1869.  
  1870.     NAME
  1871.         emsexist
  1872.  
  1873.     DESCRIPTION
  1874.         Determines if the EMS device driver is loaded.
  1875.  
  1876.     SYNOPSIS
  1877.         #include "cxlems.h"
  1878.         int emsexist(void);
  1879.  
  1880.     RETURN VALUE
  1881.         Nonzero if an EMS driver is loaded and functioning properly.
  1882.  
  1883.     ALSO SEE
  1884.         emsfree  emstotal  expmem
  1885.  
  1886.     ------------------------------------------------------------------------
  1887.  
  1888.     NAME
  1889.         emsframe
  1890.  
  1891.     DESCRIPTION
  1892.         Returns the EMS page frame base segment address.
  1893.  
  1894.     SYNOPSIS
  1895.         #include "cxlems.h"
  1896.         unsigned emsframe(void);
  1897.  
  1898.     RETURN VALUE
  1899.         The EMS page frame base segment address, or zero if an error
  1900.         occurred.
  1901.  
  1902.     ALSO SEE
  1903.         emsalloc  emsexist  emsmap
  1904.  
  1905.     EXAMPLE
  1906.         char far *p;
  1907.         p=MK_FP(emsframe(),0);
  1908.         printf("EMS memory starts at %Fp\n",p);
  1909.  
  1910.     ------------------------------------------------------------------------
  1911.  
  1912.     NAME
  1913.         emsfree
  1914.  
  1915.     DESCRIPTION
  1916.  
  1917.  
  1918.  
  1919.                                       25
  1920.  
  1921.  
  1922.         Returns the number of free EMS pages (16K blocks).
  1923.  
  1924.     SYNOPSIS
  1925.         #include "cxlems.h"
  1926.         unsigned emsfree(void);
  1927.  
  1928.     RETURN VALUE
  1929.         The number of free EMS pages.
  1930.  
  1931.     ALSO SEE
  1932.         emsalloc  emsdealloc  emstotal
  1933.  
  1934.     ------------------------------------------------------------------------
  1935.  
  1936.     NAME
  1937.         emsmap
  1938.  
  1939.     DESCRIPTION
  1940.         Maps a logical page of allocated EMS memory onto a physical page
  1941.         address.
  1942.  
  1943.     SYNOPSIS
  1944.         #include "cxlems.h"
  1945.         int emsmap(int handle,int lpage,int ppage);
  1946.  
  1947.     INPUTS
  1948.         handle - the EMS handle previosly assigned
  1949.         lpage  - the logical EMS page to map (0 - ?)
  1950.         ppage  - the physical DOS page to map to (0 - 3)
  1951.  
  1952.     RETURN VALUE
  1953.         Nonzero if an error occurred.
  1954.  
  1955.     ALSO SEE
  1956.         emsalloc  emsdealloc  emsframe
  1957.  
  1958.     ------------------------------------------------------------------------
  1959.  
  1960.     NAME
  1961.         emsread
  1962.  
  1963.     DESCRIPTION
  1964.         Reads bytes from one or more pages of allocated EMS memory.  The
  1965.         emsmap() function must be called prior to this function to make this
  1966.         memory accessible.  The source segment used will be the current EMS
  1967.         page frame segment address and the destination segment will be your
  1968.         program's data segment.
  1969.  
  1970.     SYNOPSIS
  1971.         #include "cxlems.h"
  1972.         int emsread(char *dest,unsigned emsofs,unsigned numbytes);
  1973.  
  1974.     INPUTS
  1975.         dest     - address of buffer to receive bytes read from EMS
  1976.  
  1977.  
  1978.  
  1979.                                       26
  1980.  
  1981.  
  1982.         emsofs   - offset from the EMS page frame base segment address to
  1983.                    read the bytes from.
  1984.         numbytes - the number of bytes to read
  1985.  
  1986.     RETURN VALUE
  1987.         Nonzero if an error occurred.
  1988.  
  1989.     ALSO SEE
  1990.         emsalloc  emsdealloc  emsmap  emswrite
  1991.  
  1992.     ------------------------------------------------------------------------
  1993.  
  1994.     NAME
  1995.         emstotal
  1996.  
  1997.     DESCRIPTION
  1998.         Returns the total number of EMS memory pages (16K blocks) on the
  1999.         system.
  2000.  
  2001.     SYNOPSIS
  2002.         #include "cxlems.h"
  2003.         unsigned emstotal(void);
  2004.  
  2005.     RETURN VALUE
  2006.         The total number of EMS memory pages on the system.
  2007.  
  2008.     ALSO SEE
  2009.         emsalloc  emsdealloc  emsexist  emsfree  expmem
  2010.  
  2011.     ------------------------------------------------------------------------
  2012.  
  2013.     NAME
  2014.         emsver
  2015.  
  2016.     DESCRIPTION
  2017.         Returns the version of the EMS driver in use.
  2018.  
  2019.     SYNOPSIS
  2020.         #include "cxlems.h"
  2021.         char *emsver(void);
  2022.  
  2023.     RETURN VALUE
  2024.         The address of the static string containing the EMS version number,
  2025.         or NULL if an error occurred.
  2026.  
  2027.     ALSO SEE
  2028.         emsexist
  2029.  
  2030.     ------------------------------------------------------------------------
  2031.  
  2032.     NAME
  2033.         emswrite
  2034.  
  2035.     DESCRIPTION
  2036.  
  2037.  
  2038.  
  2039.                                       27
  2040.  
  2041.  
  2042.         Writes bytes to one or more pages of EMS memory.  The emsmap()
  2043.         function must have been called prior to calling this function so
  2044.         that the EMS memory will be available.  The source segment will be
  2045.         your program's data segment and the destination segment will be the
  2046.         current EMS page frame segment address.
  2047.  
  2048.     SYNOPSIS
  2049.         #include "cxlems.h"
  2050.         int emswrite(char *src,unsigned emsofs,unsigned numbytes);
  2051.  
  2052.     INPUTS
  2053.         src      - address of buffer that contains the bytes to be written
  2054.         emsofs   - offset from EMS page frame base segment address to write
  2055.                    bytes to
  2056.         numbytes - number of bytes to write
  2057.  
  2058.     RETURN VALUE
  2059.         Nonzero if an error occurred.
  2060.  
  2061.     ALSO SEE
  2062.         emsexist  emsframe  emsmap  emsread
  2063.  
  2064.     ------------------------------------------------------------------------
  2065.  
  2066.     NAME
  2067.         expmem
  2068.  
  2069.     DESCRIPTION
  2070.         Determines the amount, if any, of expanded memory on the system.  An
  2071.         EMS driver does not have to be loaded to call this function.
  2072.  
  2073.     SYNOPSIS
  2074.         #include "cxldef.h"
  2075.         unsigned expmem(void);
  2076.  
  2077.     RETURN VALUE
  2078.         The amount of expanded memory in kilobytes.
  2079.  
  2080.     ALSO SEE
  2081.         emsexist  extmem
  2082.  
  2083.     ------------------------------------------------------------------------
  2084.  
  2085.     NAME
  2086.         extmem
  2087.  
  2088.     DESCRIPTION
  2089.         Determines the amount of extended memory on an AT-class machine.
  2090.  
  2091.     SYNOPSIS
  2092.         #include "cxldef.h"
  2093.         unsigned extmem(void);
  2094.  
  2095.     RETURN VALUE
  2096.  
  2097.  
  2098.  
  2099.                                       28
  2100.  
  2101.  
  2102.         The amount of extended memory in kilobytes.
  2103.  
  2104.     ALSO SEE
  2105.         expmem
  2106.  
  2107.     ------------------------------------------------------------------------
  2108.  
  2109.     NAME
  2110.         fcrypt
  2111.  
  2112.     DESCRIPTION
  2113.         Encrypts or decrypts a text or binary file using a modified XOR
  2114.         encryption method.  The same encryption key string must be used when
  2115.         decrypting the file as when encrypting it.
  2116.  
  2117.     SYNOPSIS
  2118.         #include "cxldef.h"
  2119.         int fcrypt(char *file,char *key);
  2120.  
  2121.     INPUTS
  2122.         file - address of filename string of file to encrypt or decrypt.
  2123.         key  - address of encryption key string.  The string can contain any
  2124.                ASCII characters (01 - FF).  The longer the string is, the
  2125.                better the encryption.  Do not lose the key, or you won't see
  2126.                your data again!
  2127.  
  2128.     RETURN VALUE
  2129.         Nonzero if an error occurred.
  2130.  
  2131.     ALSO SEE
  2132.         strcode
  2133.  
  2134.     EXAMPLE
  2135.         fcrypt("CXL.DOC","This is my encryption key string");
  2136.  
  2137.     ------------------------------------------------------------------------
  2138.  
  2139.     NAME
  2140.         fill_
  2141.  
  2142.     DESCRIPTION
  2143.         Fills in a region of the screen with a specified character and
  2144.         attribute.
  2145.  
  2146.     SYNOPSIS
  2147.         #include "cxlvid.h"
  2148.         void fill_(int srow,int scol,int erow,int ecol,int ch,int attr);
  2149.  
  2150.     INPUTS
  2151.         srow - start row
  2152.         scol - start column
  2153.         erow - end row
  2154.         ecol - end column
  2155.         ch   - character to fill with
  2156.  
  2157.  
  2158.  
  2159.                                       29
  2160.  
  2161.  
  2162.         attr - attribute of character
  2163.  
  2164.     ALSO SEE
  2165.         attrib  box_
  2166.  
  2167.     EXAMPLE
  2168.         fill_(5,15,16,42,'X',LRED|_MAGENTA);
  2169.  
  2170.     ------------------------------------------------------------------------
  2171.  
  2172.     NAME
  2173.         freonkey
  2174.  
  2175.     DESCRIPTION
  2176.         Frees all active onkey definitions from memory.  After this call,
  2177.         any keys defined using setonkey() will no longer be active.
  2178.  
  2179.     SYNOPSIS
  2180.         #include "cxlkey.h"
  2181.         void freonkey(void);
  2182.  
  2183.     ALSO SEE
  2184.         chgonkey  setonkey
  2185.  
  2186.     ------------------------------------------------------------------------
  2187.  
  2188.     NAME
  2189.         gameport
  2190.  
  2191.     DESCRIPTION
  2192.         Determines if a game port is installed.
  2193.  
  2194.     SYNOPSIS
  2195.         #include "cxldef.h"
  2196.         int gameport(void);
  2197.  
  2198.     RETURN VALUE
  2199.         Nonzero if a game port is installed.
  2200.  
  2201.     ALSO SEE
  2202.         mathchip  numflop  numpar  numser
  2203.  
  2204.     ------------------------------------------------------------------------
  2205.  
  2206.     NAME
  2207.         getchf
  2208.  
  2209.     DESCRIPTION
  2210.         Gets a character from the keyboard from a list of valid characters.
  2211.         The case of the letters in the valid character list is ignored.
  2212.         Provides Escape checking.
  2213.  
  2214.     SYNOPSIS
  2215.         #include "cxlkey.h"
  2216.  
  2217.  
  2218.  
  2219.                                       30
  2220.  
  2221.  
  2222.         int getchf(char *valid,int defchar);
  2223.  
  2224.     INPUTS
  2225.         valid   - address of string containing list of valid characters
  2226.         defchar - default selection in case [Enter] is pressed, or zero if
  2227.                   you don't want to have a default selection
  2228.  
  2229.     RETURN VALUE
  2230.         The character pressed, or zero if the [Esc] key was pressed.   The
  2231.         returned character will be uppercase.
  2232.  
  2233.     ALSO SEE
  2234.         getxch  waitkey
  2235.  
  2236.     EXAMPLE
  2237.         int ch;
  2238.         printf("Are you sure? ");
  2239.         ch=getchf("YN",'Y');
  2240.         if(!ch) printf("[Esc] was pressed\n");
  2241.  
  2242.     ------------------------------------------------------------------------
  2243.  
  2244.     NAME
  2245.         getcursz
  2246.  
  2247.     DESCRIPTION
  2248.         Returns the start and stop scan lines of cursor.
  2249.  
  2250.     SYNOPSIS
  2251.         #include "cxlvid.h"
  2252.         void getcursz(int *sline,int *eline);
  2253.  
  2254.     INPUTS
  2255.         sline - address of integer to receive start scan line
  2256.         eline - address of integer to receive stop scan line
  2257.  
  2258.     ALSO SEE
  2259.         setcursz
  2260.  
  2261.     EXAMPLE
  2262.         int sline,eline;
  2263.         getcursz(&sline,&eline);
  2264.         printf("Cursor start & stop scan lines:  %d, %d\n",sline,eline);
  2265.  
  2266.     ------------------------------------------------------------------------
  2267.  
  2268.     NAME
  2269.         getns
  2270.  
  2271.     DESCRIPTION
  2272.         Inputs a string of a specified maximum length from the keyboard.
  2273.         Provides Escape checking.
  2274.  
  2275.     SYNOPSIS
  2276.  
  2277.  
  2278.  
  2279.                                       31
  2280.  
  2281.  
  2282.         #include "cxlkey.h"
  2283.         int getns(char *str,int maxchars);
  2284.  
  2285.     INPUTS
  2286.         str      - address of buffer to receive input string
  2287.         maxchars - maximum length of the input string
  2288.  
  2289.     RETURN VALUE
  2290.         Nonzero if the [Esc] key was pressed during user input.
  2291.  
  2292.     ALSO SEE
  2293.         inputsf
  2294.  
  2295.     EXAMPLE
  2296.         char name[11];
  2297.         printf("Enter your name: ");
  2298.         if(getns(name,10))
  2299.             printf("\n[Esc] was pressed\n");
  2300.         else
  2301.             printf("\nYour name is:  %s\n",name);
  2302.  
  2303.     ------------------------------------------------------------------------
  2304.  
  2305.     NAME
  2306.         getxch
  2307.  
  2308.     DESCRIPTION
  2309.         Gets a key (ASCII code/scan code) from the keyboard.  All CXL
  2310.         functions that interract with the keyboard call this function for
  2311.         input.
  2312.  
  2313.     SYNOPSIS
  2314.         #include "cxlkey.h"
  2315.         unsigned getxch(void);
  2316.  
  2317.     RETURN VALUE
  2318.         The keycode of the pressed key.  The keycode contains the scan code
  2319.         of the keypress in the upper byte, and the ASCII character in the
  2320.         lower byte.  A list of keycodes is in Appendix B.
  2321.  
  2322.     ALSO SEE
  2323.         getchf
  2324.  
  2325.     EXAMPLE
  2326.         unsigned int keycode;
  2327.         printf("Press a key:  ");
  2328.         keycode=getxch();
  2329.         printf("%c\nkeycode = %#x, scancode = %d, ASCII code = %d\n"
  2330.             ,keycode,keycode,keycode>>8,keycode&0x00ff);
  2331.  
  2332.     ------------------------------------------------------------------------
  2333.  
  2334.     NAME
  2335.         gotoxy_
  2336.  
  2337.  
  2338.  
  2339.                                       32
  2340.  
  2341.  
  2342.     DESCRIPTION
  2343.         Sets cursor coordinates on the screen.
  2344.  
  2345.     SYNOPSIS
  2346.         #include "cxlvid.h"
  2347.         void gotoxy_(int row,int col);
  2348.  
  2349.     INPUTS
  2350.         row - cursor row (Y coordinate)
  2351.         col - cursor column (X coordinate)
  2352.  
  2353.     ALSO SEE
  2354.         readcur
  2355.  
  2356.     ------------------------------------------------------------------------
  2357.  
  2358.     NAME
  2359.         hidecur
  2360.  
  2361.     DESCRIPTION
  2362.         Hides the cursor.  Retains the cursor shape so that when showcur()
  2363.         is called, the original cursor shape will be restored.
  2364.  
  2365.     SYNOPSIS
  2366.         #include "cxlvid.h"
  2367.         void hidecur(void);
  2368.  
  2369.     ALSO SEE
  2370.         lgcursor  setcursz  showcur  smcursor
  2371.  
  2372.     ------------------------------------------------------------------------
  2373.  
  2374.     NAME
  2375.         inputsf
  2376.  
  2377.     DESCRIPTION
  2378.         Inputs a formatted string from the keyboard.  This function provides
  2379.         an extremely powerful method of accept single-line input from the
  2380.         user.  You can limit input characters to certain characters of a
  2381.         type, such as numbers, insert strings in between typed in
  2382.         characters, create custom prompts, disable [Enter] until the field
  2383.         is filled, and more.  Provides Escape checking.
  2384.  
  2385.     SYNOPSIS
  2386.         #include "cxlkey.h"
  2387.         int inputsf(char *str,char *fmt);
  2388.  
  2389.     INPUTS
  2390.         str - address of the buffer receive input string
  2391.         fmt - address of the format string.  See Appendix D for valid format
  2392.               string characters.
  2393.  
  2394.     RETURN VALUE
  2395.         0 - no error
  2396.  
  2397.  
  2398.  
  2399.                                       33
  2400.  
  2401.  
  2402.         1 - [Esc] key was pressed
  2403.         2 - invalid format string
  2404.  
  2405.     ALSO SEE
  2406.         getns
  2407.  
  2408.     EXAMPLE
  2409.         char buf[21];
  2410.         if(inputsf(buf,"'Enter your name:  '!M!AAAAAAAAAAAAAAAAAAAA")==1)
  2411.             printf("\n[Esc] key was pressed\n");
  2412.         else
  2413.             printf("\nYour name is:  %s\n",buf);
  2414.  
  2415.     ------------------------------------------------------------------------
  2416.  
  2417.     NAME
  2418.         kbclear
  2419.  
  2420.     DESCRIPTION
  2421.         Clears CXL's internal keyboard buffer.
  2422.  
  2423.     SYNOPSIS
  2424.         #include "cxlkey.h"
  2425.         void kbclear(void);
  2426.  
  2427.     ALSO SEE
  2428.         clearkeys  kbmhit  kbput  kbputs
  2429.  
  2430.     ------------------------------------------------------------------------
  2431.  
  2432.     NAME
  2433.         kbmhit
  2434.  
  2435.     DESCRIPTION
  2436.         Determines if a key has been pressed and is waiting to be got. Also
  2437.         checks for mouse button presses.  Replaces the kbhit() function.
  2438.  
  2439.     SYNOPSIS
  2440.         #include "cxlkey.h"
  2441.         int kbmhit(void);
  2442.  
  2443.     RETURN VALUE
  2444.         Nonzero if a key is waiting to be got.
  2445.  
  2446.     ALSO SEE
  2447.         kbclear
  2448.  
  2449.     ------------------------------------------------------------------------
  2450.  
  2451.     NAME
  2452.         kbput
  2453.  
  2454.     DESCRIPTION
  2455.         Places a keystroke into CXL's internal keyboard buffer.  This will
  2456.  
  2457.  
  2458.  
  2459.                                       34
  2460.  
  2461.  
  2462.         only affect CXL's keyboard input functions.  This function is useful
  2463.         for making keyboard scripts for demos, etc., or forcing user
  2464.         keyboard input.
  2465.  
  2466.     SYNOPSIS
  2467.         #include "cxlkey.h"
  2468.         int kbput(unsigned xch);
  2469.  
  2470.     INPUTS
  2471.         xch - keycode of keypress to place in buffer.  The scan code will be
  2472.               in the high byte and the ASCII code will be in the low byte.
  2473.               See Appendix B for a list of keycodes which you can use.
  2474.  
  2475.     RETURN VALUE
  2476.         Nonzero if memory allocation error.
  2477.  
  2478.     ALSO SEE
  2479.         kbclear  kbputs
  2480.  
  2481.     EXAMPLE
  2482.         kbput(0x011b);  /* puts an [Esc] keypress into CXL's buffer */
  2483.  
  2484.     ------------------------------------------------------------------------
  2485.  
  2486.     NAME
  2487.         kbputs
  2488.  
  2489.     DESCRIPTION
  2490.         Places a string of characters into CXL's internal keyboard buffer.
  2491.         This will only affect CXL's keyboard input functions.  This function
  2492.         is useful for making keyboard scripts for demos, etc., and forcing
  2493.         user keyboard input.
  2494.  
  2495.     SYNOPSIS
  2496.         #include "cxlkey.h"
  2497.         int kbputs(char *str);
  2498.  
  2499.     INPUTS
  2500.         str - address of string of characters to stuff into buffer
  2501.  
  2502.     RETURN VALUE
  2503.         Nonzero if memory allocation error.
  2504.  
  2505.     ALSO SEE
  2506.         kbclear  kbput
  2507.  
  2508.     EXAMPLE
  2509.         char buf[21];
  2510.         kbputs("Mike");
  2511.         printf("Enter your name:  ");
  2512.         getns(buf,20);
  2513.  
  2514.     ------------------------------------------------------------------------
  2515.  
  2516.  
  2517.  
  2518.  
  2519.                                       35
  2520.  
  2521.  
  2522.     NAME
  2523.         kbstat
  2524.  
  2525.     DESCRIPTION
  2526.         Returns the status of the keyboard control keys.
  2527.  
  2528.     SYNOPSIS
  2529.         #include "cxlkey.h"
  2530.         unsigned kbstat(void);
  2531.  
  2532.     RETURN VALUE
  2533.         Status word of the keyboard flag.  You can determine which key(s)
  2534.         are being pressed/toggled by masking the status word (using the
  2535.         bitwise '&' operator) with one of the following:
  2536.             RSHIFT   - right shift pressed
  2537.             LSHIFT   - left shift pressed
  2538.             CTRL     - [Ctrl] pressed
  2539.             ALT      - [Alt] pressed
  2540.             SCRLOCK  - [ScrollLock] toggled
  2541.             NUMLOCK  - [NumLock] toggled
  2542.             CAPSLOCK - [CapsLock] toggled
  2543.             INS      - [Ins] toggled
  2544.  
  2545.     ALSO SEE
  2546.         capsoff  capson  numoff  numon
  2547.  
  2548.     EXAMPLE
  2549.         printf("NumLock is %s\n",(kbstat()&NUMLOCK)?"on":"off");
  2550.  
  2551.     ------------------------------------------------------------------------
  2552.  
  2553.     NAME
  2554.         lcrlf
  2555.  
  2556.     DESCRIPTION
  2557.         Prints a carriage return and line feed on the printer (PRN).
  2558.  
  2559.     SYNOPSIS
  2560.         #include "cxlprn.h"
  2561.         void lcrlf(void);
  2562.  
  2563.     ALSO SEE
  2564.         lprintc  lprintf  lprints
  2565.  
  2566.     ------------------------------------------------------------------------
  2567.  
  2568.     NAME
  2569.         lgcursor
  2570.  
  2571.     DESCRIPTION
  2572.         Makes the cursor large.
  2573.  
  2574.     SYNOPSIS
  2575.         #include "cxlvid.h"
  2576.  
  2577.  
  2578.  
  2579.                                       36
  2580.  
  2581.  
  2582.         void lgcursor(void);
  2583.  
  2584.     ALSO SEE
  2585.         hidecur  setcursz  showcur  smcursor
  2586.  
  2587.     ------------------------------------------------------------------------
  2588.  
  2589.     NAME
  2590.         lprintc
  2591.  
  2592.     DESCRIPTION
  2593.         Prints a character on the printer (PRN).
  2594.  
  2595.     SYNOPSIS
  2596.         #include "cxlprn.h"
  2597.         void lprintc(int ch);
  2598.  
  2599.     INPUTS
  2600.         ch - the character to print
  2601.  
  2602.     ALSO SEE
  2603.         lcrlf  lprintf
  2604.  
  2605.     EXAMPLE
  2606.         lprintc(12);    /* sends a form feed to the printer */
  2607.  
  2608.     ------------------------------------------------------------------------
  2609.  
  2610.     NAME
  2611.         lprintf
  2612.  
  2613.     DESCRIPTION
  2614.         Sends formatted output to the printer (PRN).  Works similar to the
  2615.         standard C printf() function.
  2616.  
  2617.     SYNOPSIS
  2618.         #include "cxlprn.h"
  2619.         void lprintf(const char *format,...);
  2620.  
  2621.     INPUTS
  2622.         format - format string.  Refer to the section on printf() in your
  2623.                  compiler's run-time library reference.
  2624.         ...    - any additional arguments
  2625.  
  2626.     ALSO SEE
  2627.         lcrlf  lprintc  lprintns  lprints
  2628.  
  2629.     EXAMPLE
  2630.         char s[]="Hello";
  2631.         int i=5;
  2632.         char c='Z';
  2633.         lprintf("s = %s, i = %d, c = %c\n\f",s,i,c);
  2634.  
  2635.     ------------------------------------------------------------------------
  2636.  
  2637.  
  2638.  
  2639.                                       37
  2640.  
  2641.  
  2642.     NAME
  2643.         lprintns
  2644.  
  2645.     DESCRIPTION
  2646.         Prints a string to a fixed width on the printer (PRN).
  2647.  
  2648.     SYNOPSIS
  2649.         #include "cxlprn.h"
  2650.         void lprintns(char *str,int width);
  2651.  
  2652.     INPUTS
  2653.         str   - the address of the string to print
  2654.         width - width to print string, either by padding or truncating.
  2655.  
  2656.     ALSO SEE
  2657.         lcrlf  lprintf  lprints  lprintsu
  2658.  
  2659.     EXAMPLE
  2660.         char string[]="Hello, world";
  2661.         lprintns(string,5);
  2662.         lprintf(".\n");
  2663.         lprintns(string,20);
  2664.         lprintf(".\n");
  2665.  
  2666.     ------------------------------------------------------------------------
  2667.  
  2668.     NAME
  2669.         lprints
  2670.  
  2671.     DESCRIPTION
  2672.         Prints a string on the printer (PRN).
  2673.  
  2674.     SYNOPSIS
  2675.         #include "cxlprn.h"
  2676.         void lprints(char *str);
  2677.  
  2678.     INPUTS
  2679.         str - the address of the string to print
  2680.  
  2681.     ALSO SEE
  2682.         lcrlf  lprintf  lprintns  lprintsu
  2683.  
  2684.     EXAMPLE
  2685.         lprints("Hello, world\n");
  2686.  
  2687.     ------------------------------------------------------------------------
  2688.  
  2689.     NAME
  2690.         lprintsb
  2691.  
  2692.     DESCRIPTION
  2693.         Prints a bold-faced string on the printer (PRN).
  2694.  
  2695.     SYNOPSIS
  2696.  
  2697.  
  2698.  
  2699.                                       38
  2700.  
  2701.  
  2702.         #include "cxlprn.h"
  2703.         void lprintsb(char *str,int reps);
  2704.  
  2705.     INPUTS
  2706.         str  - address of the string to print
  2707.         reps - number of strike repetitions (the more, the darker the print)
  2708.  
  2709.     ALSO SEE
  2710.         lcrlf  lprintf  lprintns  lprints  lprintsu
  2711.  
  2712.     ------------------------------------------------------------------------
  2713.  
  2714.     NAME
  2715.         lprintsu
  2716.  
  2717.     DESCRIPTION
  2718.         Prints an underlined string on the printer (PRN).
  2719.  
  2720.     SYNOPSIS
  2721.         #include "cxlprn.h"
  2722.         void lprintsu(char *str);
  2723.  
  2724.     INPUTS
  2725.         str - address of the string to print
  2726.  
  2727.     ALSO SEE
  2728.         lcrlf  lprintf  lprintns  lprints  lprintsb
  2729.  
  2730.     ------------------------------------------------------------------------
  2731.  
  2732.     NAME
  2733.         machid
  2734.  
  2735.     DESCRIPTION
  2736.         Returns the value of the machine ROM ID byte.
  2737.  
  2738.     SYNOPSIS
  2739.         #include "cxldef.h"
  2740.         int machid(void);
  2741.  
  2742.     RETURN VALUE
  2743.         The value of the machine ROM ID byte.  Will usually be one of the
  2744.         following values.  Any other value is unknown.
  2745.             IBMPC    - IBM PC
  2746.             IBMPCXT  - IBM PC/XT
  2747.             IBMPCJR  - IBM PCjr
  2748.             IBMPCAT  - IBM PC/AT
  2749.             IBMPCXT2 - IBM PC/XT-2
  2750.             IBMCONV  - IBM PC Convertible
  2751.             SPERRYPC - Sperry PC
  2752.  
  2753.     ALSO SEE
  2754.         biosver
  2755.  
  2756.  
  2757.  
  2758.  
  2759.                                       39
  2760.  
  2761.  
  2762.     ------------------------------------------------------------------------
  2763.  
  2764.     NAME
  2765.         mapattr
  2766.  
  2767.     DESCRIPTION
  2768.         Translates a color text attribute into its approximate monochrome
  2769.         equivalent.  All of CXL's video functions automatically call this,
  2770.         so you would only need to call this for your own functions.
  2771.  
  2772.     SYNOPSIS
  2773.         #include "cxlvid.h"
  2774.         int mapattr(int attr);
  2775.  
  2776.     INPUTS
  2777.         attr - the color text attribute to translate
  2778.  
  2779.     RETURN VALUE
  2780.         The monochrome equivalent of the color text attribute.
  2781.  
  2782.     ALSO SEE
  2783.         revsattr
  2784.  
  2785.     EXAMPLE
  2786.         int attr=LCYAN|_BLUE;
  2787.         prints(0,0,attr,"In living color!");
  2788.         _vinfo.mapattr=1;   /* force monochrome attributes */
  2789.         prints(1,0,mapattr(attr),"In dull monochrome....");
  2790.  
  2791.     ------------------------------------------------------------------------
  2792.  
  2793.     NAME
  2794.         mathchip
  2795.  
  2796.     DESCRIPTION
  2797.         Determines if a math coprocessor is installed.
  2798.  
  2799.     SYNOPSIS
  2800.         #include "cxldef.h"
  2801.         int mathchip(void);
  2802.  
  2803.     RETURN VALUE
  2804.         Nonzero if a math coprocessor is installed.
  2805.  
  2806.     ALSO SEE
  2807.         gameport  numflop  numpar  numser
  2808.  
  2809.     EXAMPLE
  2810.         printf("You do %shave a math coprocessor\n",mathchip()?"":"not ");
  2811.  
  2812.     ------------------------------------------------------------------------
  2813.  
  2814.     NAME
  2815.         mode
  2816.  
  2817.  
  2818.  
  2819.                                       40
  2820.  
  2821.  
  2822.     DESCRIPTION
  2823.         Sets the video mode.
  2824.  
  2825.     SYNOPSIS
  2826.         #include "cxlvid.h"
  2827.         void mode(int mode_code);
  2828.  
  2829.     INPUTS
  2830.         mode_code - video mode code
  2831.  
  2832.     ALSO SEE
  2833.         setlines  vidmode  vidtype
  2834.  
  2835.     ------------------------------------------------------------------------
  2836.  
  2837.     NAME
  2838.         msbclear
  2839.  
  2840.     DESCRIPTION
  2841.         Clears the mouse driver's "button presses" and "button releases"
  2842.         counters (removes them from the queue).
  2843.  
  2844.     SYNOPSIS
  2845.         #include "cxlmou.h"
  2846.         void msbclear(void);
  2847.  
  2848.     ALSO SEE
  2849.         kbmhit  msbpress  msbreles  msinit  msstatus
  2850.  
  2851.     ------------------------------------------------------------------------
  2852.  
  2853.     NAME
  2854.         msbpress
  2855.  
  2856.     DESCRIPTION
  2857.         Returns information about the specific button presses of mouse.
  2858.  
  2859.     SYNOPSIS
  2860.         #include "cxlmou.h"
  2861.         void msbpress(int button,int *bstat,int *bcount,int *row,int *col);
  2862.  
  2863.     INPUTS
  2864.         button - button to check:
  2865.                     0 - left button
  2866.                     1 - right button
  2867.                     2 - middle button (if applicable)
  2868.         bstat  - address of integer to receive button status word.  Possible
  2869.                  button status values are:
  2870.                     0 - no buttons pressed
  2871.                     1 - left button pressed
  2872.                     2 - right button pressed
  2873.                     4 - middle button pressed (if applicable)
  2874.                     3 - left & right buttons pressed
  2875.                     5 - left & middle buttons pressed (if applicable)
  2876.  
  2877.  
  2878.  
  2879.                                       41
  2880.  
  2881.  
  2882.                     6 - middle & right buttons pressed (if applicable)
  2883.                     7 - all 3 buttons pressed (if applicable)
  2884.         bcount - address of integer to receive number of times pressed since
  2885.                  last call
  2886.         row    - address of integer to receive row at time of button press
  2887.         col    - address of integer to receive column at time of button
  2888.                  press
  2889.  
  2890.     ALSO SEE
  2891.         msbclear  msbreles  msinit  msstatus
  2892.  
  2893.     EXAMPLE
  2894.         int bstat,bcount,row,col;
  2895.         msbpress(0,&bstat,&bcount,&row,&col);
  2896.  
  2897.     ------------------------------------------------------------------------
  2898.  
  2899.     NAME
  2900.         msbreles
  2901.  
  2902.     DESCRIPTION
  2903.         Returns informmation about specific button releases of mouse.
  2904.  
  2905.     SYNOPSIS
  2906.         #include "cxlmou.h"
  2907.         void msbreles(int button,int *bstat,int *bcount,int *row,int *col);
  2908.  
  2909.     INPUTS
  2910.         button - button to check:
  2911.                     0 - left button
  2912.                     1 - right button
  2913.                     2 - middle button (if applicable)
  2914.         bstat  - address of integer to receive button status word.  Possible
  2915.                  button status values are:
  2916.                     0 - no buttons pressed
  2917.                     1 - left button pressed
  2918.                     2 - right button pressed
  2919.                     4 - middle button pressed (if applicable)
  2920.                     3 - left & right buttons pressed
  2921.                     5 - left & middle buttons pressed (if applicable)
  2922.                     6 - middle & right buttons pressed (if applicable)
  2923.                     7 - all 3 buttons pressed (if applicable)
  2924.         bcount - address of integer to receive number of times released
  2925.                  since last call
  2926.         row    - address of integer to receive row at time of button release
  2927.         col    - address of integer to receive column at time of button
  2928.                  release
  2929.  
  2930.     ALSO SEE
  2931.         msbclear  msbpress  msinit  msstatus
  2932.  
  2933.     EXAMPLE
  2934.         int bstat,bcount,row,col;
  2935.         msbreles(0,&bstat,&bcount,&row,&col);
  2936.  
  2937.  
  2938.  
  2939.                                       42
  2940.  
  2941.  
  2942.     ------------------------------------------------------------------------
  2943.  
  2944.     NAME
  2945.         mscondoff
  2946.  
  2947.     DESCRIPTION
  2948.         Conditionally hides the mouse cursor depending on whether or not the
  2949.         mouse cursor falls within the input screen coordinates.
  2950.  
  2951.     SYNOPSIS
  2952.         #include "cxlmou.h"
  2953.         void mscondoff(int srow,int scol,int erow,int ecol);
  2954.  
  2955.     INPUTS
  2956.         srow - start row
  2957.         scol - start column
  2958.         erow - end row
  2959.         ecol - end column
  2960.  
  2961.     ALSO SEE
  2962.         mshidecur  msinit  msshowcur
  2963.  
  2964.     ------------------------------------------------------------------------
  2965.  
  2966.     NAME
  2967.         mscursor
  2968.  
  2969.     DESCRIPTION
  2970.         Sets the mouse text cursor type.  The mouse cursor can be a hardware
  2971.         or softare cursor.  The hardware cursor is the same as the normal
  2972.         cursor you see when you are at the DOS prompt.  Because the mouse's
  2973.         hardware cursor is the same as the normal cursor, they can interfere
  2974.         with each other, making this method impractical to use in most
  2975.         cases.  The software mouse cursor is a text box that can reveal the
  2976.         underlying character.  This is the cursor most used by programs
  2977.         including other CXL mouse support functions.
  2978.  
  2979.     SYNOPSIS
  2980.         #include "cxlmou.h"
  2981.         void mscursor(unsigned curtype,unsigned smask,unsigned cmask);
  2982.  
  2983.     INPUTS
  2984.         curtype - cursor type.  0=software, 1=hardware
  2985.         smask   - screen mask (software cursor) or start scan line (hardware
  2986.                   cursor).  If using a software cursor, the screen mask
  2987.                   determines which of the characters attributes are
  2988.                   preserved. It is ANDed with the screen character and
  2989.                   attribute.  The bit format for both smask and cmask are:
  2990.                       Bit     Content
  2991.                       ---     -------
  2992.                       0-7   - ASCII character code
  2993.                       8-10  - foreground color
  2994.                       11    - 0=intensity off, 1=intensity on
  2995.                       12-14 - background color
  2996.  
  2997.  
  2998.  
  2999.                                       43
  3000.  
  3001.  
  3002.                       15    - 0=no blink, 1=blink
  3003.         cmask   - cursor mask (software cursor) or stop scan line (hardware
  3004.                   cursor).  If using a software cursor, the cursor mask is
  3005.                   used to determine which of the characteristics are changed
  3006.                   by the cursor.  The cmask is XORed with the result of
  3007.                   (smask AND character-attribute).  The bit values for cmask
  3008.                   are the same as those for smask.
  3009.  
  3010.     ALSO SEE
  3011.         msinit  msshowcur
  3012.  
  3013.     EXAMPLE
  3014.         mscursor(1,1,7);    /* makes a full-block hardware cursor */
  3015.         msshowcur();
  3016.  
  3017.     ------------------------------------------------------------------------
  3018.  
  3019.     NAME
  3020.         msgotoxy
  3021.  
  3022.     DESCRIPTION
  3023.         Sets the mouse cursor coordinates.
  3024.  
  3025.     SYNOPSIS
  3026.         #include "cxlmou.h"
  3027.         void msgotoxy(int row,int col);
  3028.  
  3029.     INPUTS
  3030.         row - row (Y coordinate)
  3031.         col - column (X coordinate)
  3032.  
  3033.     ALSO SEE
  3034.         msinit  msstatus
  3035.  
  3036.     EXAMPLE
  3037.         msgotoxy(13,45);    /* sets mouse cursor to row 13, column 45 */
  3038.  
  3039.     ------------------------------------------------------------------------
  3040.  
  3041.     NAME
  3042.         mshbounds
  3043.  
  3044.     DESCRIPTION
  3045.         Sets the mouse's upper and lower horizontal bounds.
  3046.  
  3047.     SYNOPSIS
  3048.         #include "cxlmou.h"
  3049.         void mshbounds(int leftcol,int rightcol);
  3050.  
  3051.     INPUTS
  3052.         leftcol  - left column boundary
  3053.         rightcol - right column boundary
  3054.  
  3055.     ALSO SEE
  3056.  
  3057.  
  3058.  
  3059.                                       44
  3060.  
  3061.  
  3062.         msinit  msvbounds
  3063.  
  3064.     EXAMPLE
  3065.         mshbounds(5,45);    /* restricts mouse cursor movement */
  3066.                             /* between columns 5 & 45          */
  3067.  
  3068.     ------------------------------------------------------------------------
  3069.  
  3070.     NAME
  3071.         mshidecur
  3072.  
  3073.     DESCRIPTION
  3074.         Hides the mouse cursor.
  3075.  
  3076.     SYNOPSIS
  3077.         #include "cxlmou.h"
  3078.         void mshidecur(void);
  3079.  
  3080.     ALSO SEE
  3081.         msinit  msshowcur
  3082.  
  3083.     ------------------------------------------------------------------------
  3084.  
  3085.     NAME
  3086.         msinit
  3087.  
  3088.     DESCRIPTION
  3089.         Determines if a mouse is present.  If so, initializes mouse and sets
  3090.         the global variable _mouse to MS_KEYS which causes mouse movements
  3091.         to be translated to the keyboard arrow keys.
  3092.  
  3093.     SYNOPSIS
  3094.         #include "cxlmou.h"
  3095.         int msinit(void);
  3096.  
  3097.     RETURN VALUE
  3098.         Nonzero if mouse is present.
  3099.  
  3100.     ALSO SEE
  3101.         mssupport
  3102.  
  3103.     EXAMPLE
  3104.         if(msinit())
  3105.             printf("Mouse initialized\n");
  3106.         else
  3107.             printf("Mouse does not exist\n");
  3108.  
  3109.     ------------------------------------------------------------------------
  3110.  
  3111.     NAME
  3112.         msmotion
  3113.  
  3114.     DESCRIPTION
  3115.         Gets information about the movement of the mouse.
  3116.  
  3117.  
  3118.  
  3119.                                       45
  3120.  
  3121.  
  3122.     SYNOPSIS
  3123.         #include "cxlmou.h"
  3124.         void msmotion(int *rowcount,int *colcount);
  3125.  
  3126.     INPUTS
  3127.         rowcount - address of integer to receive number of rows moved
  3128.         colcount - address of integer to receive number of columns moved
  3129.  
  3130.     ALSO SEE
  3131.         msinit  msstatus
  3132.  
  3133.     EXAMPLE
  3134.         int rowcount,colcount;
  3135.         msmotion(&rowcount,&colcount);
  3136.  
  3137.     ------------------------------------------------------------------------
  3138.  
  3139.     NAME
  3140.         msshowcur
  3141.  
  3142.     DESCRIPTION
  3143.         Reveals the hidden mouse cursor.
  3144.  
  3145.     SYNOPSIS
  3146.         #include "cxlmou.h"
  3147.         void msshowcur(void);
  3148.  
  3149.     ALSO SEE
  3150.         mscursor  mshidecur  msinit
  3151.  
  3152.     ------------------------------------------------------------------------
  3153.  
  3154.     NAME
  3155.         msspeed
  3156.  
  3157.     DESCRIPTION
  3158.         Adjusts the mouse's speed by changing its sensitivity.
  3159.  
  3160.     SYNOPSIS
  3161.         #include "cxlmou.h"
  3162.         void msspeed(int xratio,int yratio);
  3163.  
  3164.     INPUTS
  3165.         xratio - horizontal speed (higher numbers are slower)
  3166.         yratio - vertical speed (higher numbers are slower)
  3167.  
  3168.     ALSO SEE
  3169.         msinit
  3170.  
  3171.     ------------------------------------------------------------------------
  3172.  
  3173.     NAME
  3174.         msstatus
  3175.  
  3176.  
  3177.  
  3178.  
  3179.                                       46
  3180.  
  3181.  
  3182.     DESCRIPTION
  3183.         Returns the status of the mouse.
  3184.  
  3185.     SYNOPSIS
  3186.         #include "cxlmou.h"
  3187.         void msstatus(int *bstat,int *row,int *col);
  3188.  
  3189.     INPUTS
  3190.         bstat - address of integer to receive button status word.  Possible
  3191.                 button status values are:
  3192.                     0 - no buttons pressed
  3193.                     1 - left button pressed
  3194.                     2 - right button pressed
  3195.                     4 - middle button pressed (if applicable)
  3196.                     3 - left & right buttons pressed
  3197.                     5 - left & middle buttons pressed (if applicable)
  3198.                     6 - middle & right buttons pressed (if applicable)
  3199.                     7 - all 3 buttons pressed (if applicable)
  3200.         row   - address of integer to receive current row coordinate
  3201.         col   - address of integer to receive current column coordinate
  3202.  
  3203.     ALSO SEE
  3204.         msinit
  3205.  
  3206.     EXAMPLE
  3207.         int bstat,row,col;
  3208.         msstatus(&bstat,&row,&col);
  3209.         printf("The mouse cursor is at row %d, column %d\n",row,col);
  3210.  
  3211.     ------------------------------------------------------------------------
  3212.  
  3213.     NAME
  3214.         mssupport
  3215.  
  3216.     DESCRIPTION
  3217.         Selects the type of mouse support to be used by CXL functions which
  3218.         support them.  If no mouse exists, the call to this function is
  3219.         ignored. This function should be called after msinit().
  3220.  
  3221.     SYNOPSIS
  3222.         #include "cxlmou.h"
  3223.         void mssupport(int type);
  3224.  
  3225.     INPUTS
  3226.         type - type of mouse support.  Can be one of the following:
  3227.                    MS_NONE - no mouse support
  3228.                    MS_KEYS - mouse movements are translated into keystrokes.
  3229.                              This is the default set by msinit() if it finds
  3230.                              a mouse driver present.
  3231.                    MS_CURS - point-and-shoot mouse cursor where supported
  3232.                    MS_FULL - full mouse support.  If a CXL function supports
  3233.                              a point-and-shoot mouse cursor, then that will
  3234.                              be used, otherwise mouse movements will be
  3235.                              translated into keystrokes.
  3236.  
  3237.  
  3238.  
  3239.                                       47
  3240.  
  3241.  
  3242.     ALSO SEE
  3243.         msinit
  3244.  
  3245.     EXAMPLE
  3246.         mssupport(MS_FULL);
  3247.  
  3248.     ------------------------------------------------------------------------
  3249.  
  3250.     NAME
  3251.         msvbounds
  3252.  
  3253.     DESCRIPTION
  3254.         Sets the mouse's left and right vertical bounds.
  3255.  
  3256.     SYNOPSIS
  3257.         #include "cxlmou.h"
  3258.         void msvbounds(int toprow,int botrow);
  3259.  
  3260.     INPUTS
  3261.         toprow - top row boundary
  3262.         botrow - bottom row boundary
  3263.  
  3264.     ALSO SEE
  3265.         mshbounds  msinit
  3266.  
  3267.     EXAMPLE
  3268.         msvbounds(3,20);    /* restricts mouse cursor movement */
  3269.                             /* between rows 3 and 20           */
  3270.  
  3271.     ------------------------------------------------------------------------
  3272.  
  3273.     NAME
  3274.         numflop
  3275.  
  3276.     DESCRIPTION
  3277.         Returns the number of floppy disk drives installed.
  3278.  
  3279.     SYNOPSIS
  3280.         #include "cxldef.h"
  3281.         int numflop(void);
  3282.  
  3283.     RETURN VALUE
  3284.         The number of floppy disk drives installed
  3285.  
  3286.     ALSO SEE
  3287.         gameport  mathchip  numpar  numser
  3288.  
  3289.     EXAMPLE
  3290.         printf("You have %d floppy drives installed\n",numflop());
  3291.  
  3292.     ------------------------------------------------------------------------
  3293.  
  3294.     NAME
  3295.         numoff
  3296.  
  3297.  
  3298.  
  3299.                                       48
  3300.  
  3301.  
  3302.     DESCRIPTION
  3303.         Toggles the NumLock key off.
  3304.  
  3305.     SYNOPSIS
  3306.         #include "cxlkey.h"
  3307.         void numoff(void);
  3308.  
  3309.     ALSO SEE
  3310.         capsoff  kbstat  numon
  3311.  
  3312.     ------------------------------------------------------------------------
  3313.  
  3314.     NAME
  3315.         numon
  3316.  
  3317.     DESCRIPTION
  3318.         Toggles the NumLock key on.
  3319.  
  3320.     SYNOPSIS
  3321.         #include "cxlkey.h"
  3322.         void numon(void);
  3323.  
  3324.     ALSO SEE
  3325.         capson  kbstat  numoff
  3326.  
  3327.     ------------------------------------------------------------------------
  3328.  
  3329.     NAME
  3330.         numpar
  3331.  
  3332.     DESCRIPTION
  3333.         Returns the number of parallel ports.
  3334.  
  3335.     SYNOPSIS
  3336.         #include "cxldef.h"
  3337.         int numpar(void);
  3338.  
  3339.     RETURN VALUE
  3340.         The number of parallel ports installed.
  3341.  
  3342.     ALSO SEE
  3343.         gameport  mathchip  numflop  numser
  3344.  
  3345.     EXAMPLE
  3346.         printf("You have %d parallel ports\n",numpar());
  3347.  
  3348.     ------------------------------------------------------------------------
  3349.  
  3350.     NAME
  3351.         numser
  3352.  
  3353.     DESCRIPTION
  3354.         Returns the number of serial ports installed.
  3355.  
  3356.  
  3357.  
  3358.  
  3359.                                       49
  3360.  
  3361.  
  3362.     SYNOPSIS
  3363.         #include "cxldef.h"
  3364.         int numser(void);
  3365.  
  3366.     RETURN VALUE
  3367.         The number of serial ports installed.
  3368.  
  3369.     ALSO SEE
  3370.         gameport  mathchip  numflop  numpar
  3371.  
  3372.     EXAMPLE
  3373.         printf("You have %d serial ports\n",numser());
  3374.  
  3375.     ------------------------------------------------------------------------
  3376.  
  3377.     NAME
  3378.         printc
  3379.  
  3380.     DESCRIPTION
  3381.         Displays a character to the screen at a specified location, using a
  3382.         specified attribute.  Does not recognize control characters.  Does
  3383.         not affect cursor position.
  3384.  
  3385.     SYNOPSIS
  3386.         #include "cxlvid.h"
  3387.         void printc(int row,int col,int attr,int ch);
  3388.  
  3389.     INPUTS
  3390.         row  - row to display character at
  3391.         col  - column to display character at
  3392.         attr - text attribute for character
  3393.         ch   - character to print
  3394.  
  3395.     ALSO SEE
  3396.         attrib  prints
  3397.  
  3398.     EXAMPLE
  3399.         printc(12,40,BLINK|LRED|_BLACK,'!');
  3400.  
  3401.     ------------------------------------------------------------------------
  3402.  
  3403.     NAME
  3404.         prints
  3405.  
  3406.     DESCRIPTION
  3407.         Displays a string on the screen at a specified location, using a
  3408.         specified attribute.  Does not affect cursor position.
  3409.  
  3410.     SYNOPSIS
  3411.         #include "cxlvid.h"
  3412.         void prints(int row,int col,int attr,char *str);
  3413.  
  3414.     INPUTS
  3415.         row  - row to display string at
  3416.  
  3417.  
  3418.  
  3419.                                       50
  3420.  
  3421.  
  3422.         col  - column to display string at
  3423.         attr - text attribute for characters displayed
  3424.         str  - address of string to display
  3425.  
  3426.     ALSO SEE
  3427.         attrib  printc
  3428.  
  3429.     EXAMPLE
  3430.         prints(24,15,YELLOW|_BROWN,"Hello, world");
  3431.  
  3432.     ------------------------------------------------------------------------
  3433.  
  3434.     NAME
  3435.         putchat
  3436.  
  3437.     DESCRIPTION
  3438.         Puts a character and its attribute on the screen at current cursor
  3439.         position using video BIOS calls.
  3440.  
  3441.     SYNOPSIS
  3442.         #include "cxlvid.h"
  3443.         void putchat(int ch,int attr);
  3444.  
  3445.     INPUTS
  3446.         ch   - character to display
  3447.         attr - attribute to display character in
  3448.  
  3449.     ALSO SEE
  3450.         readchat
  3451.  
  3452.     ------------------------------------------------------------------------
  3453.  
  3454.     NAME
  3455.         randfile
  3456.  
  3457.     DESCRIPTION
  3458.         Creates a random file name.
  3459.  
  3460.     SYNOPSIS
  3461.         #include "cxldef.h"
  3462.         char *randfile(void);
  3463.  
  3464.     RETURN VALUE
  3465.         Address of the static string containing the random file name.
  3466.  
  3467.     EXAMPLE
  3468.         printf("A random file name is:  %s\n",randfile());
  3469.  
  3470.     ------------------------------------------------------------------------
  3471.  
  3472.     NAME
  3473.         readchat
  3474.  
  3475.     DESCRIPTION
  3476.  
  3477.  
  3478.  
  3479.                                       51
  3480.  
  3481.  
  3482.         Reads the character and attribute under the cursor using video BIOS
  3483.         calls.
  3484.  
  3485.     SYNOPSIS
  3486.         #include "cxlvid.h"
  3487.         unsigned readchat(void);
  3488.  
  3489.     RETURN VALUE
  3490.         Unsigned integer containing the character in the low byte and
  3491.         attribute in the high byte.
  3492.  
  3493.     ALSO SEE
  3494.         putchat  revattr  setattr
  3495.  
  3496.     EXAMPLE
  3497.         unsigned int chat;
  3498.         chat=readchat();
  3499.         printf("character value = %d, attribute value = %d\n",chat&0x00ff
  3500.             ,chat>>8);
  3501.  
  3502.     ------------------------------------------------------------------------
  3503.  
  3504.     NAME
  3505.         readcur
  3506.  
  3507.     DESCRIPTION
  3508.         Reads the current cursor location.
  3509.  
  3510.     SYNOPSIS
  3511.         #include "cxlvid.h"
  3512.         void readcur(int *row,int *col);
  3513.  
  3514.     INPUTS
  3515.         row - address of integer to receive cursor row
  3516.         col - address of integer to receive cursor column
  3517.  
  3518.     ALSO SEE
  3519.         gotoxy_
  3520.  
  3521.     EXAMPLE
  3522.         int row,col;
  3523.         readcur(&row,&col);
  3524.         printf("The cursor is at row %d, column %d\n",row,col);
  3525.  
  3526.     ------------------------------------------------------------------------
  3527.  
  3528.     NAME
  3529.         revattr
  3530.  
  3531.     DESCRIPTION
  3532.         Reverses the attribute of the character under the current cursor
  3533.         position, and continues for the specified number of characters.
  3534.         Uses video BIOS calls.
  3535.  
  3536.  
  3537.  
  3538.  
  3539.                                       52
  3540.  
  3541.  
  3542.     SYNOPSIS
  3543.         #include "cxlvid.h"
  3544.         void revattr(int count);
  3545.  
  3546.     INPUTS
  3547.         count - the number of characters to reverse the attribute of
  3548.  
  3549.     ALSO SEE
  3550.         readchat  revsattr  setattr
  3551.  
  3552.     EXAMPLE
  3553.         prints(0,0,LCYAN|_BLUE,"Hello, world");
  3554.         gotoxy_(0,0);
  3555.         revattr(5);
  3556.  
  3557.     ------------------------------------------------------------------------
  3558.  
  3559.     NAME
  3560.         revsattr
  3561.  
  3562.     DESCRIPTION
  3563.         Returns the inverse of the given text attribute.
  3564.  
  3565.     SYNOPSIS
  3566.         #include "cxlvid.h"
  3567.         int revsattr(int attr);
  3568.  
  3569.     INPUTS
  3570.         attr - text attribute
  3571.  
  3572.     RETURN VALUE
  3573.         The inverted text attribute.
  3574.  
  3575.     ALSO SEE
  3576.         mapattr  revattr
  3577.  
  3578.     EXAMPLE
  3579.         int attr=LMAGENTA|_RED;
  3580.         prints(0,0,attr,"Normal");
  3581.         prints(1,0,revsattr(attr),"Reverse");
  3582.  
  3583.     ------------------------------------------------------------------------
  3584.  
  3585.     NAME
  3586.         scancode
  3587.  
  3588.     DESCRIPTION
  3589.         Returns the common scan code of the specified character.
  3590.  
  3591.     SYNOPSIS
  3592.         #include "cxlkey.h"
  3593.         int scancode(int ch);
  3594.  
  3595.     INPUTS
  3596.  
  3597.  
  3598.  
  3599.                                       53
  3600.  
  3601.  
  3602.         ch - an ASCII character
  3603.  
  3604.     RETURN VALUE
  3605.         The common scan code of the specified character.   The characters
  3606.         '0' thru '9', '*', '-', '+', and '.' will return their scan code
  3607.         from their regular keys, not their numeric keypad keys.
  3608.  
  3609.     ------------------------------------------------------------------------
  3610.  
  3611.     NAME
  3612.         scrndump
  3613.  
  3614.     DESCRIPTION
  3615.         Dumps the current screen to the printer (PRN).
  3616.  
  3617.     SYNOPSIS
  3618.         #include "cxlprn.h"
  3619.         void scrndump(void);
  3620.  
  3621.     ALSO SEE
  3622.         scrntodisk  ssave  videoinit
  3623.  
  3624.     ------------------------------------------------------------------------
  3625.  
  3626.     NAME
  3627.         scrntodisk
  3628.  
  3629.     DESCRIPTION
  3630.         Copies the current screen to a disk file.
  3631.  
  3632.     SYNOPSIS
  3633.         #include "cxlvid.h"
  3634.         int scrntodisk(char *fname);
  3635.  
  3636.     INPUTS
  3637.         fname  - address of the string containing the filename of the file
  3638.                  to write to
  3639.  
  3640.     RETURN VALUE
  3641.         Nonzero if an error occurred.
  3642.  
  3643.     ALSO SEE
  3644.         disktoscrn  scrndump  ssave  wintodisk
  3645.  
  3646.     ------------------------------------------------------------------------
  3647.  
  3648.     NAME
  3649.         setattr
  3650.  
  3651.     DESCRIPTION
  3652.         Sets the attribute of the character under the current cursor
  3653.         location, and continues for the specified number of characters.
  3654.         Uses video BIOS calls.
  3655.  
  3656.  
  3657.  
  3658.  
  3659.                                       54
  3660.  
  3661.  
  3662.     SYNOPSIS
  3663.         #include "cxlvid.h"
  3664.         void setattr(int attr,int count);
  3665.  
  3666.     INPUTS
  3667.         attr  - attribute to set character
  3668.         count - the number of characters to set the attribute of
  3669.  
  3670.     ALSO SEE
  3671.         attrib  readchat  revattr
  3672.  
  3673.     EXAMPLE
  3674.         prints(0,0,LCYAN|_BLUE,"Hello, world");
  3675.         gotoxy_(0,0);
  3676.         setattr(LMAGENTA|_RED,5);
  3677.  
  3678.     ------------------------------------------------------------------------
  3679.  
  3680.     NAME
  3681.         setcursz
  3682.  
  3683.     DESCRIPTION
  3684.         Sets the cursor size.  This function is video adapter dependent.
  3685.  
  3686.     SYNOPSIS
  3687.         #include "cxlvid.h"
  3688.         void setcursz(int sline,int eline);
  3689.  
  3690.     INPUTS
  3691.         sline - start line of cursor, 32 = no cursor
  3692.         eline - end line of cursor
  3693.  
  3694.     ALSO SEE
  3695.         getcursz  hidecur  lgcursor  showcur  smcursor
  3696.  
  3697.     EXAMPLE
  3698.         setcursz(1,7);  /* sets cursor to large block on color displays */
  3699.  
  3700.     ------------------------------------------------------------------------
  3701.  
  3702.     NAME
  3703.         setkbloop
  3704.  
  3705.     DESCRIPTION
  3706.         Most of the time your program is idle, it is waiting for a keypress.
  3707.         This function allows you to set up a function that will be called
  3708.         while waiting for a keypress.  For example, you could update a
  3709.         status line, or update a time clock continuously while waiting for a
  3710.         keypress.
  3711.  
  3712.     SYNOPSIS
  3713.         #include "cxlkey.h"
  3714.         void setkbloop(void (*func)(void));
  3715.  
  3716.  
  3717.  
  3718.  
  3719.                                       55
  3720.  
  3721.  
  3722.     INPUTS
  3723.         func - address of the function to be called while waiting for
  3724.                keypress or NULL to cancel the procedure.
  3725.  
  3726.     ALSO SEE
  3727.         waitkey  waitkeyt
  3728.  
  3729.     ------------------------------------------------------------------------
  3730.  
  3731.     NAME
  3732.         setlines
  3733.  
  3734.     DESCRIPTION
  3735.         Sets the number of lines on the display.  The videoinit() function
  3736.         must have previously been called.
  3737.  
  3738.     SYNOPSIS
  3739.         #include "cxlvid.h"
  3740.         int setlines(int numlines);
  3741.  
  3742.     INPUTS
  3743.         numlines - the number of lines to set the display to. Valid numbers
  3744.                    are:
  3745.                        25 - all video adapters
  3746.                        43 - EGA
  3747.                        50 - VGA
  3748.  
  3749.      RETURN VALUE
  3750.          Nonzero if an error occurred.
  3751.  
  3752.      ALSO SEE
  3753.          mode  videoinit  vidtype
  3754.  
  3755.     EXAMPLE
  3756.         printf("%s\n",setlines(43)?"You do not have an EGA card":
  3757.                "You are now in EGA 43-line mode");
  3758.  
  3759.     ------------------------------------------------------------------------
  3760.  
  3761.     NAME
  3762.         setonkey
  3763.  
  3764.     DESCRIPTION
  3765.         Attaches/detaches a keypress to a function call.  Works by
  3766.         intercepting any calls to CXL keyboard input functions.  Whenever
  3767.         you use one of CXL's keyboard input functions, the input function
  3768.         will check to see if the pressed key has been defined.  If so, then
  3769.         the input function will call the corresponding function.  If not,
  3770.         then the input function will pass on the keypress as normal.
  3771.  
  3772.     SYNOPSIS
  3773.         #include "cxlkey.h"
  3774.         int setonkey(unsigned keycode,void (*func) (void),unsigned pass);
  3775.  
  3776.  
  3777.  
  3778.  
  3779.                                       56
  3780.  
  3781.  
  3782.     INPUTS
  3783.         keycode - keycode of key to define. If the keycode was previously
  3784.                   defined, it will be re-defined.  See Appendix B for a list
  3785.                   of keycodes.
  3786.         func    - address of the function to call upon keypress.  If NULL is
  3787.                   specified for func, then the specified keycode will be
  3788.                   un-defined.
  3789.         pass    - keycode of key to pass back to caller after the onkey
  3790.                   function returns.  This allows you to have one keypress
  3791.                   return the code for another.  If pass==0, then the key
  3792.                   will not be passed back, and execution will resume where
  3793.                   the interruption occurred.
  3794.  
  3795.     RETURN VALUE
  3796.         Nonzero if a memory allocation error occurred.
  3797.  
  3798.     ALSO SEE
  3799.         chgonkey  freonkey  setkbloop
  3800.  
  3801.     EXAMPLE
  3802.         setonkey(0x011b,escape_routine,0);
  3803.  
  3804.     ------------------------------------------------------------------------
  3805.  
  3806.     NAME
  3807.         setvparam
  3808.  
  3809.     DESCRIPTION
  3810.         Sets video display parameters.
  3811.  
  3812.     SYNOPSIS
  3813.         #include "cxlvid.h"
  3814.         int setvparam(int setting);
  3815.  
  3816.     INPUTS
  3817.         setting - video display parameter.  Can be one of the following:
  3818.             VP_DMA   - turn on  direct screen writes
  3819.             VP_CGA   - turn on  direct screen writes w/CGA snow elimination
  3820.             VP_BIOS  - turn on  BIOS screen writes
  3821.             VP_MONO  - turn on  monochrome attribute translation
  3822.             VP_COLOR - turn off monochrome attribute translation
  3823.  
  3824.     RETURN VALUE
  3825.         Nonzero if error.
  3826.  
  3827.     ALSO SEE
  3828.         videoinit  vidtype
  3829.  
  3830.     ------------------------------------------------------------------------
  3831.  
  3832.     NAME
  3833.         showcur
  3834.  
  3835.     DESCRIPTION
  3836.  
  3837.  
  3838.  
  3839.                                       57
  3840.  
  3841.  
  3842.         Reveals the hidden cursor, restoring it to its previous shape.
  3843.  
  3844.     SYNOPSIS
  3845.         #include "cxlvid.h"
  3846.         void showcur(void);
  3847.  
  3848.     ALSO SEE
  3849.         hidecur  lgcursor  setcursz  smcursor
  3850.  
  3851.     ------------------------------------------------------------------------
  3852.  
  3853.     NAME
  3854.         smcursor
  3855.  
  3856.     DESCRIPTION
  3857.         Makes the cursor small.
  3858.  
  3859.     SYNOPSIS
  3860.         #include "cxlvid.h"
  3861.         void smcursor(void);
  3862.  
  3863.     ALSO SEE
  3864.         hidecur  lgcursor  setcursz  showcur
  3865.  
  3866.     ------------------------------------------------------------------------
  3867.  
  3868.     NAME
  3869.         sound_
  3870.  
  3871.     DESCRIPTION
  3872.         Sounds a tone of specified pitch and duration.
  3873.  
  3874.     SYNOPSIS
  3875.         #include "cxldef.h"
  3876.         void sound_(unsigned pitch,unsigned duration);
  3877.  
  3878.     INPUTS
  3879.         pitch    - pitch of tone (0-65535)
  3880.         duration - duration of tone (0-65535).  ie. 182 = 10 seconds
  3881.  
  3882.     ALSO SEE
  3883.         beep
  3884.  
  3885.     EXAMPLE
  3886.         sound_(5000,36);    /* sounds a tone for 2 seconds */
  3887.  
  3888.     ------------------------------------------------------------------------
  3889.  
  3890.     NAME
  3891.         spc
  3892.  
  3893.     DESCRIPTION
  3894.         Displays a specified number of spaces to the screen using the text
  3895.         attribute of the character under the cursor.
  3896.  
  3897.  
  3898.  
  3899.                                       58
  3900.  
  3901.  
  3902.     SYNOPSIS
  3903.         #include "cxlvid.h"
  3904.         void spc(int num);
  3905.  
  3906.     INPUTS
  3907.         num - number of spaces to display
  3908.  
  3909.     ------------------------------------------------------------------------
  3910.  
  3911.     NAME
  3912.         srestore
  3913.  
  3914.     DESCRIPTION
  3915.         Restores a previously saved screen, and frees the memory allocated
  3916.         by ssave().
  3917.  
  3918.     SYNOPSIS
  3919.         #include "cxlvid.h"
  3920.         void srestore(int *sbuf);
  3921.  
  3922.     INPUTS
  3923.         sbuf - address of previously saved screen buffer
  3924.  
  3925.     ALSO SEE
  3926.         ssave
  3927.  
  3928.     ------------------------------------------------------------------------
  3929.  
  3930.     NAME
  3931.         ssave
  3932.  
  3933.     DESCRIPTION
  3934.         Saves the current screen to a buffer.  To work with monochrome video
  3935.         adapters, videoinit() must have previously been called.
  3936.  
  3937.     SYNOPSIS
  3938.         #include "cxlvid.h"
  3939.         int *ssave(void);
  3940.  
  3941.     RETURN VALUE
  3942.         Address of newly created screen buffer or NULL if a memory
  3943.         allocation error occurred.
  3944.  
  3945.     ALSO SEE
  3946.         scrntodisk  srestore  videoinit  wsave
  3947.  
  3948.     EXAMPLE
  3949.         int *p;
  3950.         if((p=ssave())==NULL) {
  3951.             printf("Memory allocation error\n");
  3952.             exit(1);
  3953.         }
  3954.  
  3955.     ------------------------------------------------------------------------
  3956.  
  3957.  
  3958.  
  3959.                                       59
  3960.  
  3961.  
  3962.     NAME
  3963.         strblank
  3964.  
  3965.     DESCRIPTION
  3966.         Determines if a given string is blank (whitespace).
  3967.  
  3968.     SYNOPSIS
  3969.         #include "cxlstr.h"
  3970.         int strblank(char *str);
  3971.  
  3972.     INPUTS
  3973.         str - address of the string to check
  3974.  
  3975.     RETURN VALUE
  3976.         A zero if the string is not blank, otherwise it is.
  3977.  
  3978.     EXAMPLE
  3979.         char string1[]="  Hello  ";
  3980.         char string2[]=" \n  \t \r ";
  3981.         printf("string1 is %sblank\n",strblank(string1)?"":"not ");
  3982.         printf("string2 is %sblank\n",strblank(string2)?"":"not ");
  3983.  
  3984.     ------------------------------------------------------------------------
  3985.  
  3986.     NAME
  3987.         strbmatch
  3988.  
  3989.     DESCRIPTION
  3990.         Returns the best match of a string in an array of strings.
  3991.  
  3992.     SYNOPSIS
  3993.         #include "cxlstr.h"
  3994.         char *strbmatch(char *str,char *strarr[]);
  3995.  
  3996.     INPUTS
  3997.         str    - address of string to match
  3998.         strarr - address of array of string pointers.  The last pointer in
  3999.                  the array must be NULL.
  4000.  
  4001.     RETURN VALUE
  4002.         Address of the string in the array that best matched the given
  4003.         string.
  4004.  
  4005.     ALSO SEE
  4006.         strmatch
  4007.  
  4008.     EXAMPLE
  4009.         char *strings[]= { "Hello","There","Computer","World",NULL };
  4010.         char str1[]="xhelpx";
  4011.         printf("<%s> best matches <%s>\n",str1,strbmatch(str1,strings));
  4012.  
  4013.     ------------------------------------------------------------------------
  4014.  
  4015.     NAME
  4016.  
  4017.  
  4018.  
  4019.                                       60
  4020.  
  4021.  
  4022.         strbtrim
  4023.  
  4024.     DESCRIPTION
  4025.         Trims both leading and trailing spaces off of a string.
  4026.  
  4027.     SYNOPSIS
  4028.         #include "cxlstr.h"
  4029.         char *strbtrim(char *str);
  4030.  
  4031.     INPUTS
  4032.         The address of the string to modify.
  4033.  
  4034.     RETURN VALUE
  4035.         The address of the modified string.
  4036.  
  4037.     ALSO SEE
  4038.         strltrim  strtrim
  4039.  
  4040.     EXAMPLE
  4041.         char str[]="  Hello  ";
  4042.         printf("Before:  <%s>\n",str);
  4043.         strbtrim(str);
  4044.         printf("After:   <%s>\n",str);
  4045.  
  4046.     ------------------------------------------------------------------------
  4047.  
  4048.     NAME
  4049.         strchg
  4050.  
  4051.     DESCRIPTION
  4052.         Finds all letters in a string matching one character and replaces
  4053.         them with another.
  4054.  
  4055.     SYNOPSIS
  4056.         #include "cxlstr.h"
  4057.         int strchg(char *str,int oldch,int newch);
  4058.  
  4059.     INPUTS
  4060.         str   - address of string to search
  4061.         oldch - character to search for
  4062.         newch - character to replace with
  4063.  
  4064.     RETURN VALUE
  4065.         The number of matches found.
  4066.  
  4067.     ALSO SEE
  4068.         strichg
  4069.  
  4070.     EXAMPLE
  4071.         char str[]="Hello, world";
  4072.         printf("Before:  %s\n",str);
  4073.         strchg(str,'l','z');
  4074.         printf("After:   %s\n",str);
  4075.  
  4076.  
  4077.  
  4078.  
  4079.                                       61
  4080.  
  4081.  
  4082.     ------------------------------------------------------------------------
  4083.  
  4084.     NAME
  4085.         strchksum
  4086.  
  4087.     DESCRIPTION
  4088.         Returns the checksum of a string.  The checksum is calculated by
  4089.         adding up the ASCII values of each character in the string.
  4090.  
  4091.     SYNOPSIS
  4092.         #include "cxlstr.h"
  4093.         unsigned long strchksum(char *str);
  4094.  
  4095.     INPUTS
  4096.         str - address of the string
  4097.  
  4098.     RETURN VALUE
  4099.         The checksum of the input string.
  4100.  
  4101.     ALSO SEE
  4102.         strichksum
  4103.  
  4104.     EXAMPLE
  4105.         printf("The checksum of <Hello> is %lu\n",strchksum("Hello"));
  4106.  
  4107.     ------------------------------------------------------------------------
  4108.  
  4109.     NAME
  4110.         strcode
  4111.  
  4112.     DESCRIPTION
  4113.         Encrypts/decrypts a string.  Call this function to encrypt a string,
  4114.         then call again using the same key to decrypt it.  When reading or
  4115.         writing from a disk file, be sure to open the file in binary mode.
  4116.  
  4117.     SYNOPSIS
  4118.         #include "cxlstr.h"
  4119.         char *strcode(char *str,char *key);
  4120.  
  4121.     INPUTS
  4122.         str - the address of the string to encrypt/decrypt
  4123.         key - the address of the key string to encrypt/decrypt with. The
  4124.               string can consist of any valid characters (01-FF) and can be
  4125.               of any length.  Remember this key or your data will be lost
  4126.               forever!
  4127.  
  4128.     RETURN VALUE
  4129.         The address of the encrypted/decrypted string.
  4130.  
  4131.     ALSO SEE
  4132.         fcrypt
  4133.  
  4134.     EXAMPLE
  4135.         char str[]="Hello, world";
  4136.  
  4137.  
  4138.  
  4139.                                       62
  4140.  
  4141.  
  4142.         printf("Before:     %s\n",str);
  4143.         strcode(str,"34&*#Mdq");
  4144.         printf("Encrypted:  %s\n",str);
  4145.         strcode(str,"34&*#Mdq");
  4146.         printf("Decrypted:  %s\n",str);
  4147.  
  4148.     ------------------------------------------------------------------------
  4149.  
  4150.     NAME
  4151.         strdel
  4152.  
  4153.     DESCRIPTION
  4154.         Deletes a substring from within a string.
  4155.  
  4156.     SYNOPSIS
  4157.         #include "cxlstr.h"
  4158.         char *strdel(char *substr,char *str);
  4159.  
  4160.     INPUTS
  4161.         substr - address of substring to delete
  4162.         str    - address of string to delete substring from
  4163.  
  4164.     RETURN VALUE
  4165.         A NULL if the substring was not found, or the address of the
  4166.         modified string.
  4167.  
  4168.     ALSO SEE
  4169.         strdela  stridel  stridela  strinc  strins  strmid
  4170.  
  4171.     EXAMPLE
  4172.         char str[]="Hello there, world";
  4173.         printf("Before:  %s\n",str);
  4174.         strdel(" there",str);
  4175.         printf("After:   %s\n",str);
  4176.  
  4177.     ------------------------------------------------------------------------
  4178.  
  4179.     NAME
  4180.         strdela
  4181.  
  4182.     DESCRIPTION
  4183.         Deletes all occurrences of a substring from within a string.
  4184.  
  4185.     SYNOPSIS
  4186.         #include "cxlstr.h"
  4187.         char *strdela(char *substr,char *str);
  4188.  
  4189.     INPUTS
  4190.          substr - the address of the substring to search for
  4191.          str    - the address of string to search
  4192.  
  4193.     RETURN VALUE
  4194.         The address of the modified string, or a NULL if no matches were
  4195.         found.
  4196.  
  4197.  
  4198.  
  4199.                                       63
  4200.  
  4201.  
  4202.     ALSO SEE
  4203.         strdel  stridel  stridela
  4204.  
  4205.     EXAMPLE
  4206.         char str[]="xyzHello, xyzworldxyz";
  4207.         printf("Before: <%s>\n",str);
  4208.         strdela("xyz",str);
  4209.         printf("After:  <%s>\n",str);
  4210.  
  4211.     ------------------------------------------------------------------------
  4212.  
  4213.     NAME
  4214.         strichg
  4215.  
  4216.     DESCRIPTION
  4217.         Finds all letters in a string matching one character and replaces
  4218.         them with another.  Ignores case of letters.
  4219.  
  4220.     SYNOPSIS
  4221.         #include "cxlstr.h"
  4222.         int strichg(char *str,int oldch,int newch);
  4223.  
  4224.     INPUTS
  4225.         str    - address of string to search
  4226.         oldch  - character to search for
  4227.         newch  - character to replace oldch with
  4228.  
  4229.     RETURN VALUE
  4230.         The number of matches found.
  4231.  
  4232.     ALSO SEE
  4233.         strchg
  4234.  
  4235.     EXAMPLE
  4236.         char str[]="HelLo, worLd";
  4237.         printf("Before:  %s\n",str);
  4238.         strichg(str,'l','l');
  4239.         printf("After:   %s\n",str);
  4240.  
  4241.     ------------------------------------------------------------------------
  4242.  
  4243.     NAME
  4244.         strichksum
  4245.  
  4246.     DESCRIPTION
  4247.         Returns the checksum of a string.  The checksum is calculated by
  4248.         adding up the ASCII values of each character in the string.  All
  4249.         lowercase letters will be counted as uppercase.
  4250.  
  4251.     SYNOPSIS
  4252.         #include "cxlstr.h"
  4253.         unsigned long strichksum(char *str);
  4254.  
  4255.     INPUTS
  4256.  
  4257.  
  4258.  
  4259.                                       64
  4260.  
  4261.  
  4262.         str - address of the string
  4263.  
  4264.     RETURN VALUE
  4265.         The checksum of the input string.
  4266.  
  4267.     ALSO SEE
  4268.         strchksum
  4269.  
  4270.     EXAMPLE
  4271.         printf("The checksum of <Hello> is %lu\n",strichksum("Hello"));
  4272.  
  4273.     ------------------------------------------------------------------------
  4274.  
  4275.     NAME
  4276.         stridel
  4277.  
  4278.     DESCRIPTION
  4279.         Deletes a substring from within a string.  Ignores case of letters.
  4280.  
  4281.     SYNOPSIS
  4282.         #include "cxlstr.h"
  4283.         char *stridel(char *substr,char *str);
  4284.  
  4285.     INPUTS
  4286.         substr - address of substring to delete
  4287.         str    - address of string to delete substring from
  4288.  
  4289.     RETURN VALUE
  4290.         A NULL if the substring was not found, or the address of the
  4291.         modified string.
  4292.  
  4293.     ALSO SEE
  4294.         strdel  strdela  stridela  striinc
  4295.  
  4296.     EXAMPLE
  4297.         char str[]="Hello tHeRe, world";
  4298.         printf("Before:  %s\n",str);
  4299.         stridel(" ThErE",str);
  4300.         printf("After:   %s\n",str);
  4301.  
  4302.     ------------------------------------------------------------------------
  4303.  
  4304.     NAME
  4305.         stridela
  4306.  
  4307.     DESCRIPTION
  4308.         Deletes all occurrences of a substring from within a string.
  4309.         Ignores case of letters.
  4310.  
  4311.     SYNOPSIS
  4312.         #include "cxlstr.h"
  4313.         char *stridela(char *substr,char *str);
  4314.  
  4315.     INPUTS
  4316.  
  4317.  
  4318.  
  4319.                                       65
  4320.  
  4321.  
  4322.          substr - the address of the substring to search for
  4323.          str    - the address of string to search
  4324.  
  4325.     RETURN VALUE
  4326.         The address of the modified string, or a NULL if no matches were
  4327.         found.
  4328.  
  4329.     ALSO SEE
  4330.         strdel  strdela  stridel
  4331.  
  4332.     EXAMPLE
  4333.         char str[]="XyZHello, xYzworldXyZ";
  4334.         printf("Before: <%s>\n",str);
  4335.         strdela("xYz",str);
  4336.         printf("After:  <%s>\n",str);
  4337.  
  4338.     ------------------------------------------------------------------------
  4339.  
  4340.     NAME
  4341.         striinc
  4342.  
  4343.     DESCRIPTION
  4344.         Determines if and where one string is included within another.
  4345.         Ignores case of letters.
  4346.  
  4347.     SYNOPSIS
  4348.         #include "cxlstr.h"
  4349.         char *striinc(char *str1,char *str2);
  4350.  
  4351.     INPUTS
  4352.         str1 - address of the string to search for
  4353.         str2 - address of the string to search
  4354.  
  4355.     RETURN VALUE
  4356.         The address where string1 is included in string2, or a NULL if
  4357.         string1 is not included in string2.
  4358.  
  4359.     ALSO SEE
  4360.         strinc  strmid
  4361.  
  4362.     EXAMPLE
  4363.         char str[]="Hello, world";
  4364.         printf("<ElLo> is %sincluded in <%s>\n"
  4365.             ,striinc("ElLo",str)==NULL?"not ":"",str);
  4366.  
  4367.     ------------------------------------------------------------------------
  4368.  
  4369.     NAME
  4370.         strinc
  4371.  
  4372.     DESCRIPTION
  4373.         Determines if and where one string is included within another.
  4374.  
  4375.     SYNOPSIS
  4376.  
  4377.  
  4378.  
  4379.                                       66
  4380.  
  4381.  
  4382.         #include "cxlstr.h"
  4383.         char *strinc(char *str1,char *str2);
  4384.  
  4385.     INPUTS
  4386.         str1 - address of the string to search for
  4387.         str2 - address of the string to search
  4388.  
  4389.     RETURN VALUE
  4390.         The address where string1 is included in string2, or a NULL if
  4391.         string1 is not included in string2.
  4392.  
  4393.     ALSO SEE
  4394.         striinc  strmid
  4395.  
  4396.     EXAMPLE
  4397.         char str[]="Hello, world";
  4398.         printf("<ElLo> is %sincluded in <%s>\n"
  4399.             ,strinc("ElLo",str)==NULL?"not ":"",str);
  4400.  
  4401.     ------------------------------------------------------------------------
  4402.  
  4403.     NAME
  4404.         strins
  4405.  
  4406.     DESCRIPTION
  4407.         Inserts one string into another.
  4408.  
  4409.     SYNOPSIS
  4410.         #include "cxlstr.h"
  4411.         char *strins(char *instr,char *str,int st_pos);
  4412.  
  4413.     INPUTS
  4414.         instr  - the address of the string to insert
  4415.         str    - the address of the string to insert instr into.  This area
  4416.                  must be large enough to hold the size of the modified
  4417.                  string.
  4418.         st_pos - the starting position of where to insert
  4419.  
  4420.     RETURN VALUE
  4421.         The address of the modified string.
  4422.  
  4423.     ALSO SEE
  4424.         strdel  strinc
  4425.  
  4426.     EXAMPLE
  4427.         char str[20]="Hello, world";
  4428.         printf("Before:  %s\n",str);
  4429.         strins(" there",str,5);
  4430.         printf("After:   %s\n",str);
  4431.  
  4432.     ------------------------------------------------------------------------
  4433.  
  4434.     NAME
  4435.         striocc
  4436.  
  4437.  
  4438.  
  4439.                                       67
  4440.  
  4441.  
  4442.     DESCRIPTION
  4443.         Returns the number of occurrences of a character in a string.
  4444.         Ignores case of letters.
  4445.  
  4446.     SYNOPSIS
  4447.         #include "cxlstr.h"
  4448.         int striocc(char *str,int ch);
  4449.  
  4450.     INPUTS
  4451.         str - address of the string to search
  4452.         ch  - the character to look for
  4453.  
  4454.     RETURN VALUE
  4455.         The number of occurrences of the character in the string.
  4456.  
  4457.     ALSO SEE
  4458.         strocc
  4459.  
  4460.     EXAMPLE
  4461.         char str[]="HelLo, world";
  4462.         printf("There are %d occurrences of '%c' in <%s>\n"
  4463.             ,striocc(str,'l'),'l',str);
  4464.  
  4465.     ------------------------------------------------------------------------
  4466.  
  4467.     NAME
  4468.         strischg
  4469.  
  4470.     DESCRIPTION
  4471.         Changes all occurrences of one string to another.  Ignores case of
  4472.         letters.
  4473.  
  4474.     SYNOPSIS
  4475.         #include "cxlstr.h"
  4476.         char *strischg(char *str,char *find,char *replace);
  4477.  
  4478.     INPUTS
  4479.         str     - address of the string to search
  4480.         find    - address of the string to search for
  4481.         replace - address of the string to replace found strings with
  4482.  
  4483.     RETURN VALUE
  4484.         The address of the modified string, or NULL if no matches were
  4485.         found.
  4486.  
  4487.     ALSO SEE
  4488.         strisrep  strschg  strsrep
  4489.  
  4490.     EXAMPLE
  4491.         char str[]="xxxhElLoyyyHElLOzzz";
  4492.         printf("Before: <%s>\n",str);
  4493.         strischg(str,"HeLlO","goodbye");
  4494.         printf("After:  <%s>\n",str);
  4495.  
  4496.  
  4497.  
  4498.  
  4499.                                       68
  4500.  
  4501.  
  4502.     ------------------------------------------------------------------------
  4503.  
  4504.     NAME
  4505.         strisocc
  4506.  
  4507.     DESCRIPTION
  4508.         Counts occurrences of one string within another.  Ignores case of
  4509.         letters.
  4510.  
  4511.     SYNOPSIS
  4512.         #include "cxlstr.h"
  4513.         int strisocc(char *str1,char *str2);
  4514.  
  4515.     INPUTS
  4516.         str1 - address of string to search for
  4517.         str2 - address of string to search
  4518.  
  4519.     RETURN VALUE
  4520.         The number of times that string str1 occurs in string str2.
  4521.  
  4522.     ALSO SEE
  4523.         strsocc
  4524.  
  4525.     EXAMPLE
  4526.         char str1[]="hello";
  4527.         char str2[]="Hello1HELLO2HeLlO3hElLo";
  4528.         printf("<%s> occurs in <%s> %d times\n",str1,str2
  4529.             ,strisocc(str1,str2));
  4530.  
  4531.     ------------------------------------------------------------------------
  4532.  
  4533.     NAME
  4534.         strisrep
  4535.  
  4536.     DESCRIPTION
  4537.         Searches for, and replaces one string within another. Ignores case
  4538.         of letters.
  4539.  
  4540.     SYNOPSIS
  4541.         #include "cxlstr.h"
  4542.         char *strisrep(char *str,char *search,char *replace);
  4543.  
  4544.     INPUTS
  4545.         str     - address of string to search.  This must have enough space
  4546.                   to hold the modified string.
  4547.         search  - address of string to search for
  4548.         replace - address of string to replace search string with
  4549.  
  4550.     RETURN VALUE
  4551.         The address of the modified string, or NULL if the search string
  4552.         wasn't found.
  4553.  
  4554.     ALSO SEE
  4555.         strischg  strschg  strsrep
  4556.  
  4557.  
  4558.  
  4559.                                       69
  4560.  
  4561.  
  4562.     EXAMPLE
  4563.         char str[24]="This is a big string";
  4564.         printf("Before:  %s\n",str);
  4565.         strisrep(str,"StR","th");
  4566.         printf("After:   %s\n",str);
  4567.  
  4568.     ------------------------------------------------------------------------
  4569.  
  4570.     NAME
  4571.         strleft
  4572.  
  4573.     DESCRIPTION
  4574.         Takes a specified portion of a string from its left and creates a
  4575.         new string.
  4576.  
  4577.     SYNOPSIS
  4578.         #include "cxlstr.h"
  4579.         char *strleft(char *str,int num_chars);
  4580.  
  4581.     INPUTS
  4582.         str        - address of input string
  4583.         num_chars  - number of characters to copy
  4584.  
  4585.     RETURN VALUE
  4586.         Address of the newly created string or a NULL if a memory allocation
  4587.         error occurred.  Be sure to free() this string if or when you don't
  4588.         need it anymore.
  4589.  
  4590.     ALSO SEE
  4591.         strmid  strright  strtrim
  4592.  
  4593.     EXAMPLE
  4594.         char *p,str[]="Hello, world";
  4595.         printf("%s\n",p=strleft(str,5));
  4596.         free(p);
  4597.  
  4598.     ------------------------------------------------------------------------
  4599.  
  4600.     NAME
  4601.         strljust
  4602.  
  4603.     DESCRIPTION
  4604.         Left justifies a text string.
  4605.  
  4606.     SYNOPSIS
  4607.         #include "cxlstr.h"
  4608.         char *strljust(char *str);
  4609.  
  4610.     INPUTS
  4611.         str - address of the string to left justify
  4612.  
  4613.     RETURN VALUE
  4614.         Address of the modified string.
  4615.  
  4616.  
  4617.  
  4618.  
  4619.                                       70
  4620.  
  4621.  
  4622.     ALSO SEE
  4623.         strrjust
  4624.  
  4625.     EXAMPLE
  4626.         char str[]="     Hello, world";
  4627.         printf("Before:  <%s>\n",str);
  4628.         strljust(str);
  4629.         printf("After:   <%s>\n",str);
  4630.  
  4631.     ------------------------------------------------------------------------
  4632.  
  4633.     NAME
  4634.         strltrim
  4635.  
  4636.     DESCRIPTION
  4637.         Trims the leading spaces off of a string.
  4638.  
  4639.     SYNOPSIS
  4640.         #include "cxlstr.h"
  4641.         char *strltrim(char *str);
  4642.  
  4643.     INPUTS
  4644.         str - address of the string to trim
  4645.  
  4646.     RETURN VALUE
  4647.         Address of the modified string.
  4648.  
  4649.     ALSO SEE
  4650.         strbtrim  strright  strsetsz  strtrim
  4651.  
  4652.     EXAMPLE
  4653.         char str[]="     Hello, world";
  4654.         printf("Before:  <%s>\n",str);
  4655.         strltrim(str);
  4656.         printf("After:   <%s>\n",str);
  4657.  
  4658.     ------------------------------------------------------------------------
  4659.  
  4660.     NAME
  4661.         strmatch
  4662.  
  4663.     DESCRIPTION
  4664.         Compares 2 strings and returns a match score.
  4665.  
  4666.     SYNOPSIS
  4667.         #include "cxlstr.h"
  4668.         int strmatch(char *str1,char *str2);
  4669.  
  4670.     INPUTS
  4671.         str1 - address of first string
  4672.         str2 - address of second string
  4673.  
  4674.     RETURN VALUE
  4675.         A match score.  The higher the score, the better they match.
  4676.  
  4677.  
  4678.  
  4679.                                       71
  4680.  
  4681.  
  4682.     ALSO SEE
  4683.         strbmatch
  4684.  
  4685.     ------------------------------------------------------------------------
  4686.  
  4687.     NAME
  4688.         strmid
  4689.  
  4690.     DESCRIPTION
  4691.         Takes a section from input string starting at given position and
  4692.         taking the given amount of characters creating a new string.
  4693.  
  4694.     SYNOPSIS
  4695.         #include "cxlstr.h"
  4696.         char *strmid(char *str,int st_pos,int num_chars);
  4697.  
  4698.     INPUTS
  4699.         str       - address of input string
  4700.         st_pos    - position in input string to start copying characters
  4701.                     (starting at position 0)
  4702.         num_chars - number of characters to copy
  4703.  
  4704.     RETURN VALUE
  4705.         Address of the newly created string or a NULL if a memory allocation
  4706.         error occurred.  Be sure to free() the string when or if you are
  4707.         finished with it.
  4708.  
  4709.     ALSO SEE
  4710.         strleft  strright
  4711.  
  4712.     EXAMPLE
  4713.         char *p,str[]="Hello there, world";
  4714.         printf("%s\n",p=strmid(str,6,5));
  4715.         free(p);
  4716.  
  4717.     ------------------------------------------------------------------------
  4718.  
  4719.     NAME
  4720.         strocc
  4721.  
  4722.     DESCRIPTION
  4723.         Returns the number of occurrences of a given character in a string.
  4724.  
  4725.     SYNOPSIS
  4726.         #include "cxlstr.h"
  4727.         int strocc(char *str,int ch);
  4728.  
  4729.     INPUTS
  4730.         str - address of the string to search
  4731.         ch  - the character to look for
  4732.  
  4733.     RETURN VALUE
  4734.         The number of occurrences of the given character in the string.
  4735.  
  4736.  
  4737.  
  4738.  
  4739.                                       72
  4740.  
  4741.  
  4742.     ALSO SEE
  4743.         striocc
  4744.  
  4745.     EXAMPLE
  4746.         char str[]="Hello, world";
  4747.         printf("There are %d occurrences of '%c' in <%s>\n"
  4748.             ,strocc(str,'l'),'l',str);
  4749.  
  4750.     ------------------------------------------------------------------------
  4751.  
  4752.     NAME
  4753.         strright
  4754.  
  4755.     DESCRIPTION
  4756.         Takes a specifed portion from the right side of a string creating a
  4757.         new string.
  4758.  
  4759.     SYNOPSIS
  4760.         #include <string.h>
  4761.         #include "cxlstr.h"
  4762.         char *strright(char *str,int num_chars);
  4763.  
  4764.     INPUTS
  4765.         str       - address of input string
  4766.         num_chars - number of characters to copy
  4767.  
  4768.     RETURN VALUE
  4769.         Address of the newly created string or a NULL if a memory allocation
  4770.         error occurred.  Be sure to free() the string when or if you are
  4771.         finished with it.
  4772.  
  4773.     ALSO SEE
  4774.         strleft  strltrim  strmid
  4775.  
  4776.     EXAMPLE
  4777.         char *p,str[]="Hello, world";
  4778.         printf("%s\n",p=strright(str,5));
  4779.         free(p);
  4780.  
  4781.     ------------------------------------------------------------------------
  4782.  
  4783.     NAME
  4784.         strrjust
  4785.  
  4786.     DESCRIPTION
  4787.         Right justifies a text string.
  4788.  
  4789.     SYNOPSIS
  4790.         #include "cxlstr.h"
  4791.         char *strrjust(char *str);
  4792.  
  4793.     INPUTS
  4794.         str - address of string to right justify
  4795.  
  4796.  
  4797.  
  4798.  
  4799.                                       73
  4800.  
  4801.  
  4802.     RETURN VALUE
  4803.         Address of modified string.
  4804.  
  4805.     ALSO SEE
  4806.         strljust
  4807.  
  4808.     EXAMPLE
  4809.         char str[]="Hello, world     ";
  4810.         printf("Before:  <%s>\n",str);
  4811.         strrjust(str);
  4812.         printf("After:   <%s>\n",str);
  4813.  
  4814.     ------------------------------------------------------------------------
  4815.  
  4816.     NAME
  4817.         strrol
  4818.  
  4819.     DESCRIPTION
  4820.         Rotates a string specified number of characters left.  The rotated
  4821.         characters wrap around to the right side of the string.
  4822.  
  4823.     SYNOPSIS
  4824.         #include "cxlstr.h"
  4825.         char *strrol(char *str,int count);
  4826.  
  4827.     INPUTS
  4828.         str   - the address of the string to rotate
  4829.         count - number of characters to rotate
  4830.  
  4831.     RETURN VALUE
  4832.         The address of the modified string.
  4833.  
  4834.     ALSO SEE
  4835.         strror  strshl
  4836.  
  4837.     EXAMPLE
  4838.         char str[]="Hello, world";
  4839.         printf("Before:  <%s>\n",str);
  4840.         strrol(str,3);
  4841.         printf("After:   <%s>\n",str);
  4842.  
  4843.     ------------------------------------------------------------------------
  4844.  
  4845.     NAME
  4846.         strror
  4847.  
  4848.     DESCRIPTION
  4849.         Rotates a string specified number of characters right.  The rotated
  4850.         characters wrap around to the left side of the string.
  4851.  
  4852.     SYNOPSIS
  4853.         #include "cxlstr.h"
  4854.         char *strror(char *str,int count);
  4855.  
  4856.  
  4857.  
  4858.  
  4859.                                       74
  4860.  
  4861.  
  4862.     INPUTS
  4863.         str   - the address of the string to rotate
  4864.         count - number of characters to rotate
  4865.  
  4866.     RETURN VALUE
  4867.         The address of the modified string.
  4868.  
  4869.     ALSO SEE
  4870.         strrol  strshr
  4871.  
  4872.     EXAMPLE
  4873.         char str[]="Hello, world";
  4874.         printf("Before:  <%s>\n",str);
  4875.         strror(str,3);
  4876.         printf("After:   <%s>\n",str);
  4877.  
  4878.     ------------------------------------------------------------------------
  4879.  
  4880.     NAME
  4881.         strschg
  4882.  
  4883.     DESCRIPTION
  4884.         Changes all occurrences of one string to another.
  4885.  
  4886.     SYNOPSIS
  4887.         #include "cxlstr.h"
  4888.         char *strschg(char *str,char *find,char *replace);
  4889.  
  4890.     INPUTS
  4891.         str     - address of the string to search
  4892.         find    - address of the string to search for
  4893.         replace - address of the string to replace found strings with
  4894.  
  4895.     RETURN VALUE
  4896.         The address of the modified string, or NULL if no matches were
  4897.         found.
  4898.  
  4899.     ALSO SEE
  4900.         strischg  strisrep  strsrep
  4901.  
  4902.     EXAMPLE
  4903.         char str[]="xxxhelloyyyhellozzz";
  4904.         printf("Before: <%s>\n",str);
  4905.         strschg(str,"hello","goodbye");
  4906.         printf("After:  <%s>\n",str);
  4907.  
  4908.     ------------------------------------------------------------------------
  4909.  
  4910.     NAME
  4911.         strsetsz
  4912.  
  4913.     DESCRIPTION
  4914.         Adjusts the length of a string, either by truncation or padding with
  4915.         spaces.
  4916.  
  4917.  
  4918.  
  4919.                                       75
  4920.  
  4921.  
  4922.     SYNOPSIS
  4923.         #include "cxlstr.h"
  4924.         char *strsetsz(char *str,int newsize);
  4925.  
  4926.     INPUTS
  4927.         str     - address of the string to modify.  This area must be large
  4928.                   enough to hold the string at its newsize length.
  4929.         newsize - the new length of the string
  4930.  
  4931.     RETURN VALUE
  4932.         The address of the modified string.
  4933.  
  4934.     ALSO SEE
  4935.         strtrim
  4936.  
  4937.     EXAMPLE
  4938.         char str[22]="Hello, world";
  4939.         printf("Before:  <%s>\n",str);
  4940.         strsetsz(str,20);
  4941.         printf("Len=20:  <%s>\n",str);
  4942.         strsetsz(str,5);
  4943.         printf("Len=5:   <%s>\n",str);
  4944.  
  4945.     ------------------------------------------------------------------------
  4946.  
  4947.     NAME
  4948.         strshl
  4949.  
  4950.     DESCRIPTION
  4951.         Shifts a string a specified number of characters left.  Characters
  4952.         that shift past the beginning of the string "drop off" and spaces
  4953.         are added to the right of the string.
  4954.  
  4955.     SYNOPSIS
  4956.         #include "cxlstr.h"
  4957.         char *strshl(char *str,int count);
  4958.  
  4959.     INPUTS
  4960.         str   - the address of the string to shift
  4961.         count - number of characters to shift
  4962.  
  4963.     RETURN VALUE
  4964.         The address of the modifed string.
  4965.  
  4966.     ALSO SEE
  4967.         strrol  strshr
  4968.  
  4969.     EXAMPLE
  4970.         char str[]="Hello, world";
  4971.         printf("Before:  <%s>\n",str);
  4972.         strshl(str,3);
  4973.         printf("After:   <%s>\n",str);
  4974.  
  4975.     ------------------------------------------------------------------------
  4976.  
  4977.  
  4978.  
  4979.                                       76
  4980.  
  4981.  
  4982.     NAME
  4983.         strshr
  4984.  
  4985.     DESCRIPTION
  4986.         Shifts a string a specified number of characters right.  Characters
  4987.         that shift past the end of the string "drop off" and spaces are
  4988.         added to the left of the string.
  4989.  
  4990.     SYNOPSIS
  4991.         #include "cxlstr.h"
  4992.         char *strshr(char *str,int count);
  4993.  
  4994.     INPUTS
  4995.         str   - the address of the string to shift
  4996.         count - number of characters to shift
  4997.  
  4998.     RETURN VALUE
  4999.         The address of the modified string.
  5000.  
  5001.     ALSO SEE
  5002.         strror  strshl
  5003.  
  5004.     EXAMPLE
  5005.         char str[]="Hello, world";
  5006.         printf("Before:  <%s>\n",str);
  5007.         strshr(str,3);
  5008.         printf("After:   <%s>\n",str);
  5009.  
  5010.     ------------------------------------------------------------------------
  5011.  
  5012.     NAME
  5013.         strsocc
  5014.  
  5015.     DESCRIPTION
  5016.         Counts the occurrences of one string within another.
  5017.  
  5018.     SYNOPSIS
  5019.         #include "cxlstr.h"
  5020.         int strsocc(char *str1,char *str2);
  5021.  
  5022.     INPUTS
  5023.         str1 - address of string to search for
  5024.         str2 - address of string to search
  5025.  
  5026.     RETURN VALUE
  5027.         The number of times that string str1 occurs in string str2.
  5028.  
  5029.     ALSO SEE
  5030.         strisocc
  5031.  
  5032.     EXAMPLE
  5033.         char str1[]="hello";
  5034.         char str2[]="Hello1hello2HeLlO3hElLo";
  5035.         printf("<%s> occurs in <%s> %d times\n",str1,str2
  5036.  
  5037.  
  5038.  
  5039.                                       77
  5040.  
  5041.  
  5042.             ,strsocc(str1,str2));
  5043.  
  5044.     ------------------------------------------------------------------------
  5045.  
  5046.     NAME
  5047.         strsrep
  5048.  
  5049.     DESCRIPTION
  5050.         Searches for, and replaces one string within another.
  5051.  
  5052.     SYNOPSIS
  5053.         #include "cxlstr.h"
  5054.         char *strsrep(char *str,char *search,char *replace);
  5055.  
  5056.     INPUTS
  5057.         str     - address of string to search
  5058.         search  - address of string to search for
  5059.         replace - address of string to replace search string with
  5060.  
  5061.     RETURN VALUE
  5062.         The address of the modified string, or NULL if the search string
  5063.         wasn't found.
  5064.  
  5065.     ALSO SEE
  5066.         strischg  strisrep  strschg
  5067.  
  5068.     EXAMPLE
  5069.         char str[24]="This is a big string";
  5070.         printf("Before:  %s\n",str);
  5071.         strsrep(str,"str","th");
  5072.         printf("After:   %s\n",str);
  5073.  
  5074.     ------------------------------------------------------------------------
  5075.  
  5076.     NAME
  5077.         strtrim
  5078.  
  5079.     DESCRIPTION
  5080.         Trims trailing spaces off of a string.
  5081.  
  5082.     SYNOPSIS
  5083.         #include "cxlstr.h"
  5084.         char *strtrim(char *str);
  5085.  
  5086.     INPUTS
  5087.         str - address of the string to trim
  5088.  
  5089.     RETURN VALUE
  5090.         Address of the modified string.
  5091.  
  5092.     ALSO SEE
  5093.         strbtrim  strleft  strltrim  strsetsz
  5094.  
  5095.     EXAMPLE
  5096.  
  5097.  
  5098.  
  5099.                                       78
  5100.  
  5101.  
  5102.         char str[]="Hello, world     ";
  5103.         printf("Before:  <%s>\n",str);
  5104.         strtrim(str);
  5105.         printf("After:   <%s>\n",str);
  5106.  
  5107.     ------------------------------------------------------------------------
  5108.  
  5109.     NAME
  5110.         struplow
  5111.  
  5112.     DESCRIPTION
  5113.         Converts a string to mixed upper & lowercase characters.
  5114.         Characters are forced to upper or lowercase depending upon the
  5115.         previous character in the string.
  5116.  
  5117.     SYNOPSIS
  5118.         #include "cxlstr.h"
  5119.         char *struplow(char *str);
  5120.  
  5121.     INPUTS
  5122.         str - the address of the string to convert
  5123.  
  5124.     RETURN VALUE
  5125.         The address of the modified string.
  5126.  
  5127.     ALSO SEE
  5128.         touplow
  5129.  
  5130.     EXAMPLE
  5131.         char str[]="hElLo, wOrLd";
  5132.         printf("Before:  <%s>\n",str);
  5133.         struplow(str);
  5134.         printf("After:   <%s>\n",str);
  5135.  
  5136.     ------------------------------------------------------------------------
  5137.  
  5138.     NAME
  5139.         sysdate
  5140.  
  5141.     DESCRIPTION
  5142.         Returns a string containing the current system date.
  5143.  
  5144.     SYNOPSIS
  5145.         #include "cxldef.h"
  5146.         char *sysdate(int dtype);
  5147.  
  5148.     INPUTS
  5149.         dtype  - date type code.  Can be one of the following:
  5150.                     Code     Example
  5151.                     ----     -------
  5152.                      0       December 3, 1988
  5153.                      1       3 Dec 88
  5154.                      2       12-3-88
  5155.                      3       12/3/88
  5156.  
  5157.  
  5158.  
  5159.                                       79
  5160.  
  5161.  
  5162.                      4       3/12/88
  5163.                      5       12/03/88
  5164.  
  5165.     RETURN VALUE
  5166.         The address of the static string containing the system date.
  5167.  
  5168.     ALSO SEE
  5169.         systime
  5170.  
  5171.     EXAMPLE
  5172.         printf("Today's date is %s\n",sysdate(0));
  5173.  
  5174.     ------------------------------------------------------------------------
  5175.  
  5176.     NAME
  5177.         systime
  5178.  
  5179.     DESCRIPTION
  5180.         Returns a string containing the current system time.
  5181.  
  5182.     SYNOPSIS
  5183.         #include "cxldef.h"
  5184.         char *systime(int ttype);
  5185.  
  5186.     INPUTS
  5187.         ttype - time type code.  Can be one of the following:
  5188.                    Code     Example
  5189.                    ----     -------
  5190.                     0       16:30:57.89
  5191.                     1       16:30:57
  5192.                     2       4:30 PM
  5193.                     3       4:30p
  5194.                     4       4:30
  5195.                     5       04:30
  5196.  
  5197.     RETURN VALUE
  5198.         The address of the static string containing the current system time.
  5199.  
  5200.     ALSO SEE
  5201.         sysdate
  5202.  
  5203.     EXAMPLE
  5204.         printf("The current time is %s\n",systime(2));
  5205.  
  5206.     ------------------------------------------------------------------------
  5207.  
  5208.     NAME
  5209.         tabstop
  5210.  
  5211.     DESCRIPTION
  5212.         Calculates a tab stop from given column and tab width.
  5213.  
  5214.     SYNOPSIS
  5215.         #include "cxldef.h"
  5216.  
  5217.  
  5218.  
  5219.                                       80
  5220.  
  5221.  
  5222.         int tabstop(int col,int tabwidth);
  5223.  
  5224.     INPUTS
  5225.         col      - column
  5226.         tabwidth - tab width
  5227.  
  5228.     RETURN VALUE
  5229.         The next tab stop column.
  5230.  
  5231.     EXAMPLE
  5232.         printf("The next tab stop after column 9 is column %d\n"
  5233.             ,tabstop(9,8));
  5234.  
  5235.     ------------------------------------------------------------------------
  5236.  
  5237.     NAME
  5238.         timer
  5239.  
  5240.     DESCRIPTION
  5241.         Returns the value of the BIOS timer.  This value is incremented by
  5242.         one every 18.2 seconds.
  5243.  
  5244.     SYNOPSIS
  5245.         #include "cxldef.h"
  5246.         unsigned long timer(void);
  5247.  
  5248.     RETURN VALUE
  5249.         Current value of the BIOS timer.
  5250.  
  5251.     ALSO SEE
  5252.         delay_
  5253.  
  5254.     EXAMPLE
  5255.         printf("Time #1:  %lu\n",timer());
  5256.         delay_(36);
  5257.         printf("Time #2:  %lu\n",timer());
  5258.  
  5259.     ------------------------------------------------------------------------
  5260.  
  5261.     NAME
  5262.         touplow
  5263.  
  5264.     DESCRIPTION
  5265.         Converts a character to upper or lowercase depending on previous
  5266.         character.  This function is used internally by other CXL functions.
  5267.  
  5268.     SYNOPSIS
  5269.         #include "cxlstr.h"
  5270.         int touplow(char *str,char *pos,int ch);
  5271.  
  5272.     INPUTS
  5273.         str - address of string
  5274.         pos - address of current position in string
  5275.         ch  - character to convert
  5276.  
  5277.  
  5278.  
  5279.                                       81
  5280.  
  5281.  
  5282.     RETURN VALUE
  5283.         The converted character.
  5284.  
  5285.     ALSO SEE
  5286.         struplow
  5287.  
  5288.     EXAMPLE
  5289.         char ch='w',str[20]="Hello, ";
  5290.         printf("The character '%c' will be appended to <%s> as '%c'\n"
  5291.             ,ch,str,touplow(str,str+7,ch));
  5292.  
  5293.     ------------------------------------------------------------------------
  5294.  
  5295.     NAME
  5296.         videoinit
  5297.  
  5298.     DESCRIPTION
  5299.         Initializes CXL's video system.  By default, all CXL functions
  5300.         performing direct screen writes go to the CGA screen memory at
  5301.         address B800:0000.  If you want these functions to work correctly
  5302.         with a monochrome video adapter or within a DESQview window, you
  5303.         must call this function. This function sets the values in the global
  5304.         structure variable _vinfo.
  5305.  
  5306.     SYNOPSIS
  5307.         #include "cxlvid.h"
  5308.         int videoinit(void);
  5309.  
  5310.     RETURN VALUE
  5311.         Video adapter type.  See the vidtype() description for all the
  5312.         possible return values.
  5313.  
  5314.     ALSO SEE
  5315.         setvparam  vidtype
  5316.  
  5317.     ------------------------------------------------------------------------
  5318.  
  5319.     NAME
  5320.         vidmode
  5321.  
  5322.     DESCRIPTION
  5323.         Returns the current video mode.
  5324.  
  5325.     SYNOPSIS
  5326.         #include "cxlvid.h"
  5327.         int vidmode(void);
  5328.  
  5329.     RETURN VALUE
  5330.         The current video mode.
  5331.  
  5332.     ALSO SEE
  5333.         mode
  5334.  
  5335.     ------------------------------------------------------------------------
  5336.  
  5337.  
  5338.  
  5339.                                       82
  5340.  
  5341.  
  5342.     NAME
  5343.         vidtype
  5344.  
  5345.     DESCRIPTION
  5346.         Determines the display adapter type.
  5347.  
  5348.     SYNOPSIS
  5349.         #include "cxlvid.h"
  5350.         int vidtype(void);
  5351.  
  5352.     RETURN VALUE
  5353.         Video adapter type.  Will be one of the following values:
  5354.             V_NONE     - no video adapter
  5355.             V_MDA      - Monochrome Display Adapter
  5356.             V_EGAMONO  - Enhanced Graphics Adapter in mono mode
  5357.             V_MCGAMONO - Multi-Color Graphics Array adapter in mono mode
  5358.             V_VGAMONO  - Video Graphics Array adapter in mono mode
  5359.             V_HGC      - Hercules Graphics Card
  5360.             V_HGCPLUS  - Hercules Graphics Card Plus
  5361.             V_INCOLOR  - Hercules InColor Card
  5362.             V_CGA      - Color Graphics Adapter
  5363.             V_EGA      - Enhanced Graphics Adapter
  5364.             V_MCGA     - Multi-Color Graphics Array adapter
  5365.             V_VGA      - Video Graphics Array adapter
  5366.  
  5367.     ALSO SEE
  5368.         mode  setvparam  videoinit
  5369.  
  5370.     ------------------------------------------------------------------------
  5371.  
  5372.     NAME
  5373.         wactiv
  5374.  
  5375.     DESCRIPTION
  5376.         Activates a previously opened window, bringing it "in front" of all
  5377.         the others.  Many windowing functions can perform their operations
  5378.         only on the active window.  If a window is not active, you will need
  5379.         to activate it before you can use it for these functions.
  5380.  
  5381.     SYNOPSIS
  5382.         #include "cxlwin.h"
  5383.         int wactiv(WINDOW whandle);
  5384.  
  5385.     INPUTS
  5386.         whandle - the window handle of the window to activate
  5387.  
  5388.     RETURN VALUE
  5389.         W_NOERROR  - no error
  5390.         W_NOTFOUND - window handle not found
  5391.         W_NOACTIVE - no open windows
  5392.  
  5393.     ALSO SEE
  5394.         wisactiv  wopen
  5395.  
  5396.  
  5397.  
  5398.  
  5399.                                       83
  5400.  
  5401.  
  5402.     EXAMPLE
  5403.         int w1,w2;
  5404.         w1=wopen(10,10,20,40,0,LCYAN|_BLUE,LCYAN|_BLUE);
  5405.         w2=wopen(0,0,15,35,1,LMAGENTA|_RED,LMAGENTA|_RED);
  5406.         wactiv(w1);
  5407.  
  5408.     ------------------------------------------------------------------------
  5409.  
  5410.     NAME
  5411.         waitkey
  5412.  
  5413.     DESCRIPTION
  5414.         Clears the keyboard buffer and halts program execution until a key
  5415.         is pressed.
  5416.  
  5417.     SYNOPSIS
  5418.         #include "cxlkey.h"
  5419.         int waitkey(void);
  5420.  
  5421.     RETURN VALUE
  5422.         The ASCII value of the key pressed.
  5423.  
  5424.     ALSO SEE
  5425.         clearkeys  getchf  waitkeyt
  5426.  
  5427.     EXAMPLE
  5428.         printf("Press any key to continue....");
  5429.         waitkey();
  5430.  
  5431.     ------------------------------------------------------------------------
  5432.  
  5433.     NAME
  5434.         waitkeyt
  5435.  
  5436.     DESCRIPTION
  5437.         Clears the keyboard buffer and halts program execution until a key
  5438.         is pressed or the specified time limit expires.
  5439.  
  5440.     SYNOPSIS
  5441.         #include "cxlkey.h"
  5442.         int waitkeyt(int duration);
  5443.  
  5444.     INPUTS
  5445.         duration - length of time to wait for keypress (ie. 182 = 10 secs.)
  5446.  
  5447.     RETURN VALUE
  5448.         The ASCII value of the key pressed or a -1 if the time limit
  5449.         expired.
  5450.  
  5451.     ALSO SEE
  5452.         clearkeys  delay_  getchf  waitkey
  5453.  
  5454.     EXAMPLE
  5455.         printf("Press any key to continue....");
  5456.  
  5457.  
  5458.  
  5459.                                       84
  5460.  
  5461.  
  5462.         waitkeyt(91);       /* time out after 5 seconds */
  5463.  
  5464.     ------------------------------------------------------------------------
  5465.  
  5466.     NAME
  5467.         wborder
  5468.  
  5469.     DESCRIPTION
  5470.         Changes the active window's border box type.  If changing to or from
  5471.         a borderless window, the window's effective area will change as
  5472.         well, changing relative coordinates within the window.
  5473.  
  5474.     SYNOPSIS
  5475.         #include "cxlwin.h"
  5476.         int wborder(int btype);
  5477.  
  5478.     INPUTS
  5479.         btype - box type.  Can be one of the following:
  5480.                     0 - single line border
  5481.                     1 - double line border
  5482.                     2 - single horz, double vert line border
  5483.                     3 - double horz, single vert line border
  5484.                     4 - thick line border
  5485.                     5 - no border (uses spaces for border chars)
  5486.  
  5487.     RETURN VALUE
  5488.         W_NOERROR  - no error
  5489.         W_NOACTIVE - no active window
  5490.         W_INVBTYPE - invalid box type
  5491.  
  5492.     ------------------------------------------------------------------------
  5493.  
  5494.     NAME
  5495.         wbox
  5496.  
  5497.     DESCRIPTION
  5498.         "Draws" a text box in the active window.
  5499.  
  5500.     SYNOPSIS
  5501.         #include "cxlwin.h"
  5502.         int wbox(int wsrow,int wscol,int werow,int wecol,int btype,
  5503.                  int attr);
  5504.  
  5505.     INPUTS
  5506.         wsrow - window start row of box
  5507.         wscol - window start column of box
  5508.         werow - window end row of box
  5509.         wecol - window end column of box
  5510.         btype - box type.  Can be one of the following:
  5511.                     0 - single line border
  5512.                     1 - double line border
  5513.                     2 - single horz, double vert line border
  5514.                     3 - double horz, single vert line border
  5515.                     4 - thick line border
  5516.  
  5517.  
  5518.  
  5519.                                       85
  5520.  
  5521.  
  5522.                     5 - no border (uses spaces for border chars)
  5523.         attr  - text attribute to use for box characters
  5524.  
  5525.     RETURN VALUE
  5526.         W_NOERROR  - no error
  5527.         W_NOACTIVE - no active window
  5528.         W_INVCOORD - invalid coordinates
  5529.  
  5530.     ALSO SEE
  5531.         wfill  whline  wvline
  5532.  
  5533.     ------------------------------------------------------------------------
  5534.  
  5535.     NAME
  5536.         wbprintc
  5537.  
  5538.     DESCRIPTION
  5539.         Displays a character on a window's border.
  5540.  
  5541.     SYNOPSIS
  5542.         #include "cxlwin.h"
  5543.         int wbprintc(int bord,int offs,int attr,int ch);
  5544.  
  5545.     INPUTS
  5546.         bord - border code.  Can be one of the following:
  5547.                 TP_BORD - top border
  5548.                 BT_BORD - bottom border
  5549.                 LT_BORD - left border
  5550.                 RT_BORD - right border
  5551.         offs - offset from window border to display character at
  5552.         attr - text attribute for displayed character
  5553.         ch   - the character to display
  5554.  
  5555.     RETURN VALUE
  5556.         W_NOERROR  - no error
  5557.         W_NOACTIVE - no active window
  5558.         W_NOBORDER - window has no border
  5559.         W_INVCOORD - border offset out of range
  5560.  
  5561.     ALSO SEE
  5562.         wmessage  wprintc
  5563.  
  5564.     EXAMPLE
  5565.         wbprintc(RT_BORD,1,WHITE|_BLACK,'*');
  5566.  
  5567.     ------------------------------------------------------------------------
  5568.  
  5569.     NAME
  5570.         wcclear
  5571.  
  5572.     DESCRIPTION
  5573.         Clears the active window using specified text attribute, then homes
  5574.         the cursor.
  5575.  
  5576.  
  5577.  
  5578.  
  5579.                                       86
  5580.  
  5581.  
  5582.     SYNOPSIS
  5583.         #include "cxlwin.h"
  5584.         int wcclear(int attr);
  5585.  
  5586.     INPUTS
  5587.         attr - text attribute to clear window with
  5588.  
  5589.     RETURN VALUE
  5590.         W_NOERROR  - no error
  5591.         W_NOACTIVE - no active window
  5592.  
  5593.     ALSO SEE
  5594.         wclear  wclreol  wclreos  wfillch
  5595.  
  5596.     EXAMPLE
  5597.         wcclear(BLACK|_BLACK);
  5598.  
  5599.     ------------------------------------------------------------------------
  5600.  
  5601.     NAME
  5602.         wcenters
  5603.  
  5604.     DESCRIPTION
  5605.         Displays a string centered in active window.  Does not recognize
  5606.         control characters.  Does not update cursor position.
  5607.  
  5608.     SYNOPSIS
  5609.         #include "cxlwin.h"
  5610.         int wcenters(int wrow,int attr,char *str);
  5611.  
  5612.     INPUTS
  5613.         wrow - window row to center string at
  5614.         attr - text attribute to use for displayed characters
  5615.         str  - address of string to display
  5616.  
  5617.     RETURN VALUE
  5618.         W_NOERROR  - no error
  5619.         W_NOACTIVE - no active window
  5620.         W_INVCOORD - invalid window row
  5621.         W_STRLONG  - string too long to be centered in window
  5622.  
  5623.     ALSO SEE
  5624.         wprints  wrjusts
  5625.  
  5626.     EXAMPLE
  5627.         wcenters(2,YELLOW|_LGREY,"Main Menu");
  5628.  
  5629.     ------------------------------------------------------------------------
  5630.  
  5631.     NAME
  5632.         wchgattr
  5633.  
  5634.     DESCRIPTION
  5635.         Changes the text attribute of the active window.  All text within
  5636.  
  5637.  
  5638.  
  5639.                                       87
  5640.  
  5641.  
  5642.         the window will be changed also.
  5643.  
  5644.     SYNOPSIS
  5645.         #include "cxlwin.h"
  5646.         int wchgattr(int battr,int wattr);
  5647.  
  5648.     INPUTS
  5649.         battr - the attribute to make the window's border
  5650.         wattr - the attribute to make the window
  5651.  
  5652.     RETURN VALUE
  5653.         W_NOERROR  - no error
  5654.         W_NOACTIVE - no active window
  5655.  
  5656.     ALSO SEE
  5657.         wtextattr
  5658.  
  5659.     EXAMPLE
  5660.         wchgattr(LMAGENTA|_RED,LCYAN|_BLUE);
  5661.  
  5662.     ------------------------------------------------------------------------
  5663.  
  5664.     NAME
  5665.         wchkbox
  5666.  
  5667.     DESCRIPTION
  5668.         Determines whether input window box coordinates are valid for use in
  5669.         the active window.
  5670.  
  5671.     SYNOPSIS
  5672.         #include "cxlwin.h"
  5673.         int wchkbox(int wsrow,int wscol,int werow,int wecol);
  5674.  
  5675.     INPUTS
  5676.         wsrow - window start row
  5677.         wscol - window start column
  5678.         werow - window end row
  5679.         wecol - window end column
  5680.  
  5681.     RETURN VALUE
  5682.         Nonzero if input window box coordinates are invalid.
  5683.  
  5684.     ALSO SEE
  5685.         wchkcol  wchkcoord  wchkrow
  5686.  
  5687.     ------------------------------------------------------------------------
  5688.  
  5689.     NAME
  5690.         wchkcol
  5691.  
  5692.     DESCRIPTION
  5693.         Determines whether input window column coordinate is valid for use
  5694.         in the active window.
  5695.  
  5696.  
  5697.  
  5698.  
  5699.                                       88
  5700.  
  5701.  
  5702.     SYNOPSIS
  5703.         #include "cxlwin.h"
  5704.         int wchkcol(int wcol);
  5705.  
  5706.     INPUTS
  5707.         wcol - window column
  5708.  
  5709.     RETURN VALUE
  5710.         Nonzero if input window column coordinate is invalid.
  5711.  
  5712.     ALSO SEE
  5713.         wchkbox  wchkcoord  wchkrow
  5714.  
  5715.     ------------------------------------------------------------------------
  5716.  
  5717.     NAME
  5718.         wchkcoord
  5719.  
  5720.     DESCRIPTION
  5721.         Determines whether input window row,column coordinates are valid for
  5722.         use in the active window.
  5723.  
  5724.     SYNOPSIS
  5725.         #include "cxlwin.h"
  5726.         int wchkcoord(int wrow,int wcol);
  5727.  
  5728.     INPUTS
  5729.         wrow - window row
  5730.         wcol - window column
  5731.  
  5732.     RETURN VALUE
  5733.         Nonzero if input window coordinates are invalid.
  5734.  
  5735.     ALSO SEE
  5736.         wchkbox  wchkcol  wchkrow
  5737.  
  5738.     ------------------------------------------------------------------------
  5739.  
  5740.     NAME
  5741.         wchkrow
  5742.  
  5743.     DESCRIPTION
  5744.         Determines whether input window row is valid for use in the active
  5745.         window.
  5746.  
  5747.     SYNOPSIS
  5748.         #include "cxlwin.h"
  5749.         int wchkrow(int wrow);
  5750.  
  5751.     INPUTS
  5752.         wrow - window row
  5753.  
  5754.     RETURN VALUE
  5755.         Nonzero if input window row is invalid.
  5756.  
  5757.  
  5758.  
  5759.                                       89
  5760.  
  5761.  
  5762.     ALSO SEE
  5763.         wchkbox  wchkcol  wchkcoord
  5764.  
  5765.     ------------------------------------------------------------------------
  5766.  
  5767.     NAME
  5768.         wclear
  5769.  
  5770.     DESCRIPTION
  5771.         Clears the active window, then homes the cursor.
  5772.  
  5773.     SYNOPSIS
  5774.         #include "cxlwin.h"
  5775.         int wclear(void);
  5776.  
  5777.     RETURN VALUE
  5778.         W_NOERROR  - no error
  5779.         W_NOACTIVE - no active window
  5780.  
  5781.     ALSO SEE
  5782.         wcclear  wclreol  wclreos  wfillch
  5783.  
  5784.     ------------------------------------------------------------------------
  5785.  
  5786.     NAME
  5787.         wclose
  5788.  
  5789.     DESCRIPTION
  5790.         Closes the active window.  If the window has a shadow, it will be
  5791.         closed as well.
  5792.  
  5793.     SYNOPSIS
  5794.         #include "cxlwin.h"
  5795.         int wclose(void);
  5796.  
  5797.     RETURN VALUE
  5798.         W_NOERROR  - no error
  5799.         W_NOACTIVE - no active window
  5800.  
  5801.     ALSO SEE
  5802.         wcloseall  wopen  wunlink
  5803.  
  5804.     ------------------------------------------------------------------------
  5805.  
  5806.     NAME
  5807.         wcloseall
  5808.  
  5809.     DESCRIPTION
  5810.         Closes all open windows.
  5811.  
  5812.     SYNOPSIS
  5813.         #include "cxlwin.h"
  5814.         int wcloseall(void);
  5815.  
  5816.  
  5817.  
  5818.  
  5819.                                       90
  5820.  
  5821.  
  5822.     RETURN VALUE
  5823.         W_NOERROR  - no error
  5824.         W_NOACTIVE - no active window
  5825.  
  5826.     ALSO SEE
  5827.         wclose  wopen
  5828.  
  5829.     ------------------------------------------------------------------------
  5830.  
  5831.     NAME
  5832.         wclreol
  5833.  
  5834.     DESCRIPTION
  5835.         Clears from the cursor to the end of the active window's line.  The
  5836.         cursor's position is not updated.
  5837.  
  5838.     SYNOPSIS
  5839.         #include "cxlwin.h"
  5840.         int wclreol(void);
  5841.  
  5842.     RETURN VALUE
  5843.         W_NOERROR   - no error
  5844.         W_NOACTIVE  - no active window
  5845.  
  5846.     ALSO SEE
  5847.         wclear  wclreos  wfillch
  5848.  
  5849.     ------------------------------------------------------------------------
  5850.  
  5851.     NAME
  5852.         wclreos
  5853.  
  5854.     DESCRIPTION
  5855.         Clears from the cursor to the end of the active window.  The
  5856.         cursor's position is not updated.
  5857.  
  5858.     SYNOPSIS
  5859.         #include "cxlwin.h"
  5860.         int wclreos(void);
  5861.  
  5862.     RETURN VALUE
  5863.         W_NOERROR  - no error
  5864.         W_NOACTIVE - no active window
  5865.  
  5866.     ALSO SEE
  5867.         wclear  wclreol  wfillch
  5868.  
  5869.     ------------------------------------------------------------------------
  5870.  
  5871.     NAME
  5872.         wcopy
  5873.  
  5874.     DESCRIPTION
  5875.         Creates a new window duplicating the active window.  The new window
  5876.  
  5877.  
  5878.  
  5879.                                       91
  5880.  
  5881.  
  5882.         becomes the active window.
  5883.  
  5884.     SYNOPSIS
  5885.         #include "cxlwin.h"
  5886.         WINDOW wcopy(int nsrow,int nscol);
  5887.  
  5888.     INPUTS
  5889.         nsrow - start row of where to place the duplicate window
  5890.         nscol - start column of where to place the duplicate window
  5891.  
  5892.     RETURN VALUE
  5893.         The window handle of the new window.  If an error occurred, a zero
  5894.         will be returned and the global variable _winfo.errno will be set to
  5895.         one of the following values:
  5896.             W_ALLOCERR - memory allocation error
  5897.             W_INVCOORD - invalid coordinates
  5898.  
  5899.     ALSO SEE
  5900.         wactiv  wmove  wopen
  5901.  
  5902.     EXAMPLE
  5903.         wopen(10,10,20,40,0,LCYAN|_BLUE,LCYAN|_BLUE);
  5904.         wcopy(0,0);
  5905.  
  5906.     ------------------------------------------------------------------------
  5907.  
  5908.     NAME
  5909.         wdelline
  5910.  
  5911.     DESCRIPTION
  5912.         Deletes a line from the active window.  Depending upon the input
  5913.         scroll direction, the lines above or below the line to delete will
  5914.         scroll to fill in the deleted line in, and a blank line will be
  5915.         added.  If what you really want to do is clear the line, you may
  5916.         want to use wclreol() instead.
  5917.  
  5918.     SYNOPSIS
  5919.         #include "cxlwin.h"
  5920.         int wdelline(int wrow,int direc);
  5921.  
  5922.     INPUTS
  5923.         wrow  - window row to delete
  5924.         direc - scroll direction.  Can be one of the following:
  5925.                     D_UP   - scroll up
  5926.                     D_DOWN - scroll down
  5927.  
  5928.     RETURN VALUE
  5929.         W_NOERROR  - no error
  5930.         W_NOACTIVE - no active window
  5931.         W_INVCOORD - invalid window row
  5932.  
  5933.     ALSO SEE
  5934.         wclreol  winsline  wscroll
  5935.  
  5936.  
  5937.  
  5938.  
  5939.                                       92
  5940.  
  5941.  
  5942.     EXAMPLE
  5943.         wdelline(3,D_UP);
  5944.  
  5945.     ------------------------------------------------------------------------
  5946.  
  5947.     NAME
  5948.         wdrag
  5949.  
  5950.     DESCRIPTION
  5951.         Smoothly drag active window one row/column in given direction.
  5952.  
  5953.     SYNOPSIS
  5954.         #include "cxlwin.h"
  5955.         int wdrag(int direction);
  5956.  
  5957.     INPUTS
  5958.         direction - direction to drag window.  Can be one of these values:
  5959.                       D_UP    - up
  5960.                       D_DOWN  - down
  5961.                       D_LEFT  - left
  5962.                       D_RIGHT - right
  5963.  
  5964.     RETURN VALUE
  5965.         W_NOERROR  - no error
  5966.         W_NOACTIVE - no active window
  5967.         W_ALLOCERR - memory allocation error
  5968.  
  5969.     ALSO SEE
  5970.         wmove  wslide
  5971.  
  5972.     ------------------------------------------------------------------------
  5973.  
  5974.     NAME
  5975.         wdump
  5976.  
  5977.     DESCRIPTION
  5978.         Dumps the active window to the default printer (PRN).
  5979.  
  5980.     SYNOPSIS
  5981.         #include "cxlwin.h"
  5982.         int wdump(void);
  5983.  
  5984.     RETURN VALUE
  5985.         W_NOERROR  - no error
  5986.         W_NOACTIVE - no active window
  5987.  
  5988.     ALSO SEE
  5989.         windump
  5990.  
  5991.     ------------------------------------------------------------------------
  5992.  
  5993.     NAME
  5994.         wdupc
  5995.  
  5996.  
  5997.  
  5998.  
  5999.                                       93
  6000.  
  6001.  
  6002.     DESCRIPTION
  6003.         Displays a character a specified number of times in the active
  6004.         window.  Characters will be displayed in the window's current text
  6005.         attribute. Control characters are recognized.  Cursor position is
  6006.         updated.
  6007.  
  6008.     SYNOPSIS
  6009.         #include "cxlwin.h"
  6010.         int wdupc(int ch,int count);
  6011.  
  6012.     INPUTS
  6013.         ch    - character to be displayed
  6014.         count - number of times to display character
  6015.  
  6016.     RETURN VALUE
  6017.         W_NOERROR  - no error
  6018.         W_NOACTIVE - no active window
  6019.  
  6020.     ALSO SEE
  6021.         wdups  wputc  wtextattr
  6022.  
  6023.     EXAMPLE
  6024.         wdupc('X',5);
  6025.  
  6026.     ------------------------------------------------------------------------
  6027.  
  6028.     NAME
  6029.         wdups
  6030.  
  6031.     DESCRIPTION
  6032.         Displays a string a specified number of times in the active window.
  6033.         Characters will be displayed in the window's current text attribute.
  6034.         Control characters are recognized.  Cursor position is updated.
  6035.  
  6036.     SYNOPSIS
  6037.         #include "cxlwin.h"
  6038.         int wdups(char *str,int count);
  6039.  
  6040.     INPUTS
  6041.         str   - character to be displayed
  6042.         count - number of times to display character
  6043.  
  6044.     RETURN VALUE
  6045.         W_NOERROR  - no error
  6046.         W_NOACTIVE - no active window
  6047.  
  6048.     ALSO SEE
  6049.         wdupc  wputs  wtextattr
  6050.  
  6051.     EXAMPLE
  6052.         wdups("Hello ",3);
  6053.  
  6054.     ------------------------------------------------------------------------
  6055.  
  6056.  
  6057.  
  6058.  
  6059.                                       94
  6060.  
  6061.  
  6062.     NAME
  6063.         werrmsg
  6064.  
  6065.     DESCRIPTION
  6066.         Most of CXL's windowing functions set the global variable
  6067.         _winfo.errno before returning to their caller.  This function,
  6068.         werrmsg(), reads _winfo.errno and returns the literal error message
  6069.         that corresponds to it.  This can be very useful in debugging
  6070.         programs that use CXL's windowing functions.  Check the individual
  6071.         windowing function descriptions to find out which ones actually set
  6072.         _winfo.errno.
  6073.  
  6074.     SYNOPSIS
  6075.         #include "cxlwin.h"
  6076.         char *werrmsg(void);
  6077.  
  6078.     RETURN VALUE
  6079.         The address of the static string containing the error message that
  6080.         corresponds to the window error code in _winfo.errno.
  6081.  
  6082.     ALSO SEE
  6083.         wperror
  6084.  
  6085.     EXAMPLE
  6086.         wgotoxy(255,255);   /* invalid coordinates */
  6087.         printf("Error = %s\n",werrmsg());
  6088.  
  6089.     ------------------------------------------------------------------------
  6090.  
  6091.     NAME
  6092.         wfill
  6093.  
  6094.     DESCRIPTION
  6095.         Fills in a region of active window with a specified character and
  6096.         attribute.
  6097.  
  6098.     SYNOPSIS
  6099.         #include "cxlwin.h"
  6100.         int wfill(int wsrow,int wscol,int werow,int wecol,int ch,int attr);
  6101.  
  6102.     INPUTS
  6103.         wsrow - window start row
  6104.         wscol - window start column
  6105.         werow - window end row
  6106.         wecol - window end column
  6107.         ch    - character to fill with
  6108.         attr  - text attribute to use for fill
  6109.  
  6110.     RETURN VALUE
  6111.         W_NOERROR  - no error
  6112.         W_NOACTIVE - no active window
  6113.         W_INVCOORD - invalid coordinates
  6114.  
  6115.     ALSO SEE
  6116.  
  6117.  
  6118.  
  6119.                                       95
  6120.  
  6121.  
  6122.         wbox
  6123.  
  6124.     EXAMPLE
  6125.         wfill(2,3,5,15,'Z',WHITE|_GREEN);
  6126.  
  6127.     ------------------------------------------------------------------------
  6128.  
  6129.     NAME
  6130.         wfillch
  6131.  
  6132.     DESCRIPTION
  6133.         Specifies which character the windowing system will use for filling
  6134.         windows with.  By default, it is a space (' ').
  6135.  
  6136.     SYNOPSIS
  6137.         #include "cxlwin.h"
  6138.         void wfillch(int ch);
  6139.  
  6140.     INPUTS
  6141.         ch - character to fill with
  6142.  
  6143.     EXAMPLE
  6144.         wfillch('\260');
  6145.  
  6146.     ------------------------------------------------------------------------
  6147.  
  6148.     NAME
  6149.         wfindrec
  6150.  
  6151.     DESCRIPTION
  6152.         Finds the address of a window record using the specified window
  6153.         handle. This is used internally be several CXL functions.
  6154.  
  6155.     SYNOPSIS
  6156.         #include "cxlwin.h"
  6157.         struct _wrec_t *wfindrec(WINDOW whandle);
  6158.  
  6159.     INPUTS
  6160.         whandle - window handle of window record to find
  6161.  
  6162.     RETURN VALUE
  6163.         The address of the found window record, or NULL if no record was
  6164.         found for the given handle.
  6165.  
  6166.     ------------------------------------------------------------------------
  6167.  
  6168.     NAME
  6169.         wgetc
  6170.  
  6171.     DESCRIPTION
  6172.         Gets a character from the keyboard.  Entered character will be
  6173.         echoed to the active window using the window's current text
  6174.         attribute.  Cursor position is updated.
  6175.  
  6176.  
  6177.  
  6178.  
  6179.                                       96
  6180.  
  6181.  
  6182.     SYNOPSIS
  6183.         #include "cxlwin.h"
  6184.         int wgetc(void);
  6185.  
  6186.     RETURN VALUE
  6187.         The ASCII value of the key pressed or a zero if an error occurred.
  6188.         If error, the global variable _winfo.errno will be set to one of the
  6189.         following:
  6190.             W_NOACTIVE - no active window
  6191.  
  6192.     ALSO SEE
  6193.         wgetchf  wscanf  wtextattr
  6194.  
  6195.     ------------------------------------------------------------------------
  6196.  
  6197.     NAME
  6198.         wgetchf
  6199.  
  6200.     DESCRIPTION
  6201.         Gets a character from the keyboard.  Allows input only of characters
  6202.         listed in the string of valid characters.  Entered characters will
  6203.         be echoed to the active window using the text attribute set by the
  6204.         wtextattr() function.  Cursor position is updated.  Escape checking
  6205.         is provided by default. This can be turned off with the wsetesc()
  6206.         function.
  6207.  
  6208.     SYNOPSIS
  6209.         #include "cxlwin.h"
  6210.         int wgetchf(char *valid,int defchar);
  6211.  
  6212.     INPUTS
  6213.         valid   - address of the string containing the valid characters
  6214.         defchar - default selection in case [Enter] is pressed, or a zero
  6215.                   for none
  6216.  
  6217.     RETURN VALUE
  6218.         The ASCII value of the key pressed, or a zero if an error occurred.
  6219.         Thre returned character will be uppercase.  If error, the global
  6220.         variable _winfo.errno will be set to one of the following:
  6221.             W_NOACTIVE - no active window
  6222.             W_ESCPRESS - [Esc] key was pressed
  6223.  
  6224.     ALSO SEE
  6225.         wgetc  wgetyn  wscanf  wtextattr
  6226.  
  6227.     EXAMPLE
  6228.         int ch;
  6229.         wputs("Quit, are you sure? ");
  6230.         if((ch=wgetchf("YN",'N'))==0) wprintf("Error:  %s\n",werrmsg());
  6231.  
  6232.     ------------------------------------------------------------------------
  6233.  
  6234.     NAME
  6235.         wgetns
  6236.  
  6237.  
  6238.  
  6239.                                       97
  6240.  
  6241.  
  6242.     DESCRIPTION
  6243.         Gets a string from the keyboard, limiting the number of characters
  6244.         input to the specified length.  Entered characters will be echoed to
  6245.         the active window using the text attribute set by the wtextattr()
  6246.         function. Cursor position is updated.  Escape checking is provided
  6247.         by default. This can be turned off with the wsetesc() function.
  6248.  
  6249.     SYNOPSIS
  6250.         #include "cxlwin.h"
  6251.         int wgetns(char *str,int maxlen);
  6252.  
  6253.     INPUTS
  6254.         str    - address of the buffer to receive the input string
  6255.         maxlen - the maximum length of the input string
  6256.  
  6257.     RETURN VALUE
  6258.         W_NOERROR  - no error
  6259.         W_NOACTIVE - no active window
  6260.         W_ESCPRESS - [Esc] key was pressed
  6261.  
  6262.     ALSO SEE
  6263.         wgets  winputsf  wscanf  wsetesc  wtextattr
  6264.  
  6265.     EXAMPLE
  6266.         char buf[6];
  6267.         wputs("Enter 5 characters:  ");
  6268.         if(wgetns(buf,5)) wprintf("Error:  %s\n",werrmsg());
  6269.  
  6270.     ------------------------------------------------------------------------
  6271.  
  6272.     NAME
  6273.         wgets
  6274.  
  6275.     DESCRIPTION
  6276.         Gets a string from the keyboard.  Entered characters will be echoed
  6277.         to the active window in the text attribute set by the wtextattr()
  6278.         function. Cursor position is updated.
  6279.  
  6280.     SYNOPSIS
  6281.         #include "cxlwin.h"
  6282.         int wgets(char *str);
  6283.  
  6284.     INPUTS
  6285.         str - the address of the buffer to receive the input string
  6286.  
  6287.     RETURN VALUE
  6288.         W_NOERROR  - no error
  6289.         W_NOACTIVE - no active window
  6290.  
  6291.     ALSO SEE
  6292.         wgetns  winputsf  wscanf  wtextattr
  6293.  
  6294.     EXAMPLE
  6295.         char name[30];
  6296.  
  6297.  
  6298.  
  6299.                                       98
  6300.  
  6301.  
  6302.         wputs("Enter your name:   ");
  6303.         wgets(name);
  6304.  
  6305.     ------------------------------------------------------------------------
  6306.  
  6307.     NAME
  6308.         wgetyn
  6309.  
  6310.     DESCRIPTION
  6311.         Gets a [Y]es or [N]o response from the keyboard.  When the user
  6312.         chooses [Y]es or [N]o, the text "Yes" or "No" will be displayed at
  6313.         the cursor location.  Escape checking is provided by default. This
  6314.         can be turned off with the wsetesc() function.
  6315.  
  6316.     SYNOPSIS
  6317.         #include "cxlwin.h"
  6318.         int wgetyn(int cdefault);
  6319.  
  6320.     INPUTS
  6321.         cdefault - the response that will be automatically selected when the
  6322.                    [Enter] key is pressed.  Zero = No, Nonzero = Yes.
  6323.  
  6324.     RETURN VALUE
  6325.         A 'Y' if Yes was selected, an 'N' if No was selected, or a '\0' if
  6326.         the user pressed [Esc] and Escape checking was on.
  6327.  
  6328.     ALSO SEE
  6329.         wgetchf  wsetesc
  6330.  
  6331.     EXAMPLE
  6332.         int choice;
  6333.         wputs("Delete, are you sure? [Y,n]: ");
  6334.         choice=wgetyn(1);
  6335.         if(choice)
  6336.             wprintf("\nYou selected:  %c\n",choice);
  6337.         else
  6338.             wprintf("\n[Esc] was pressed\n");
  6339.  
  6340.     ------------------------------------------------------------------------
  6341.  
  6342.     NAME
  6343.         wgotoxy
  6344.  
  6345.     DESCRIPTION
  6346.         Sets cursor coordinates within the active window.
  6347.  
  6348.     SYNOPSIS
  6349.         #include "cxlwin.h"
  6350.         int wgotoxy(int wrow,int wcol);
  6351.  
  6352.     INPUTS
  6353.         wrow - window row (Y coordinate)
  6354.         wcol - window column (X coordinate)
  6355.  
  6356.  
  6357.  
  6358.  
  6359.                                       99
  6360.  
  6361.  
  6362.     RETURN VALUE
  6363.         W_NOERROR  - no error
  6364.         W_NOACTIVE - no active window
  6365.         W_INVCOORD - invalid coordinates
  6366.  
  6367.     ALSO SEE
  6368.         wpgotoxy  wreadcur
  6369.  
  6370.     ------------------------------------------------------------------------
  6371.  
  6372.     NAME
  6373.         whandle
  6374.  
  6375.     DESCRIPTION
  6376.         Returns the window handle of the active window.
  6377.  
  6378.     SYNOPSIS
  6379.         #include "cxlwin.h"
  6380.         WINDOW whandle(void);
  6381.  
  6382.     RETURN VALUE
  6383.         The handle of the active window or zero if error.  If error, the
  6384.         global variable _winfo.errno will be set to one of the following:
  6385.             W_NOACTIVE - no active window
  6386.  
  6387.     ALSO SEE
  6388.         wactiv  wisactiv
  6389.  
  6390.     ------------------------------------------------------------------------
  6391.  
  6392.     Context-Sensitive Help Functions
  6393.  
  6394.     CXL's context-sensitive help system operates on the principle of a
  6395.     current help category and a help category stack.  Both require some
  6396.     explaining before you begin to use them.
  6397.  
  6398.     The current help category is the one that will be used when the user
  6399.     presses the help key.  It can be set by one of several ways.  The direct
  6400.     way is for you to explicitly set it by calling whelpcat().  There are
  6401.     also indirect ways that the current help category can be set.  Windows,
  6402.     input fields, and menu items each have individual help categories as
  6403.     part of their record.  If you were to activate a window which has its
  6404.     own help category, then that would become the current help category.
  6405.     During the processing of input fields and menus, each time you move to a
  6406.     new field or menu item item, the current help category is set to the
  6407.     whatever the field/item's help category is, even if that category is
  6408.     zero (empty). This means that input forms and menus overwrite what was
  6409.     in the current help category before the form/menu began processing.
  6410.  
  6411.     To keep from losing the current help category during the processing of
  6412.     forms and menus, you need to be able to save the current help category
  6413.     during that period.  This is where the help stack comes into the
  6414.     picture.  To save the current help category, you push it onto the stack
  6415.     with whelpush().  When you need to retrieve it, you pop it back off of
  6416.  
  6417.  
  6418.  
  6419.                                      100
  6420.  
  6421.  
  6422.     the stack using whelpop().  The category popped off of the stack then
  6423.     becomes the current help category.  This help stack is a LIFO (Last In
  6424.     First Out) stack and holds up to 20 help categories.
  6425.  
  6426.     When the help key is pressed by the user, CXL's help processor will
  6427.     search the help file for the current help category.  If the current help
  6428.     category is zero (empty), then the help category off top of the stack
  6429.     will be used.  This is where the help stack comes in handy.  It allows
  6430.     you to have a "background" help category for menu items and fields that
  6431.     don't have help categories of their own.  Before processing of the form
  6432.     or menu, you simply push the background help category onto the stack.
  6433.  
  6434.     When the help category is found in the help file, the corresponding help
  6435.     text will be displayed on the screen in the help window.  If there is
  6436.     more than 1 page of text, the user can change between pages via the
  6437.     [PgUp]/[PgDn] keys.  If there are cross-reference items, the user can
  6438.     use the arrow keys to move between them, and use [Enter] to select.
  6439.     Pressing [Esc] will exit the help window.
  6440.  
  6441.     During help processing, all keys attached to functions via setonkey()
  6442.     will be disabled to avoid conflict with the help system.  If you wish to
  6443.     have defined keys available during help processing, you can define them
  6444.     using setonkey() in the "open" function specified in the whelpdef()
  6445.     function.  If you define any keys in the "open" function, you will not
  6446.     need to worry about freeing them as the help processor will free any
  6447.     user-defined keys before exiting help.
  6448.  
  6449.     The size and placement of the help window are adjustable.  The help
  6450.     window size by default is 19 rows by 64 columns centered on the screen.
  6451.     This can be changed using whelpwin().  The whelpwin() function sets the
  6452.     screen coordinates to be used when opening the help window and can be
  6453.     called any time after whelpdef().  If you ever want to disengage the
  6454.     help system, just call whelpundef().
  6455.  
  6456.     Creating help files is quite easy.  You need to have an ASCII editor to
  6457.     create them with.  Your help file can contain several help categories.
  6458.     Here is an example of a couple of defined help categories:
  6459.  
  6460.         *B 1,Help Category 1
  6461.             help text help text help text
  6462.              help text help text help text
  6463.            help text help text help text
  6464.         *P
  6465.            help text help text help text
  6466.              help text help text help text
  6467.            help text help text help text
  6468.         *E
  6469.  
  6470.         *B 2,Help Category 2
  6471.             help text help text help text
  6472.              help text help text help text
  6473.            help text help text help text
  6474.         *P
  6475.            help text help text help text
  6476.  
  6477.  
  6478.  
  6479.                                      101
  6480.  
  6481.  
  6482.              help text help text help text
  6483.            help text help text help text
  6484.            Also see:    ^Help Category 1^
  6485.         *E
  6486.  
  6487.     The "*B" indicator specifies the beginning of a help category.  The
  6488.     format is "*B helpcatnumber[,helpcatname]".  The help category number is
  6489.     the number of the help category that you set using whelpcat().   There
  6490.     should be only one space between the "*B" and the help category number.
  6491.     The help category name is only required for cross-references.  If there
  6492.     are no cross-references to that help category, then you can leave the
  6493.     helpcatname parameter out.
  6494.  
  6495.     The "*P" indicator specifies a page break and is optional.  You may have
  6496.     as many page breaks as you'd like. The "*E" indicator specifies the end
  6497.     of the help category.  The "*B", "*P", and "*E" indicators must all
  6498.     begin in the first column.  These indicators and the help category name
  6499.     are case insensitive (can be in lowercase, uppercase, or mixed).
  6500.  
  6501.     CXL represents help categories as integers.  When assigning help
  6502.     category numbers in the help file, you should start at 1 and go up from
  6503.     there.  Help category 0 is reserved to represent an empty help category.
  6504.  
  6505.     In the definition of Help Category 2, you will notice the cross-
  6506.     reference to Help Category 1.  All cross-referencing is done by
  6507.     embedding the cross-reference category name (not number) inside carats
  6508.     (^).  If you need to display a carat inside the help file, use a double
  6509.     carat (^^).
  6510.  
  6511.     Any text contained outside of the "*B" and "*E" will be treated as
  6512.     comments.  If an "*E" is not found, then the end-of-file will be treated
  6513.     as an "*E".
  6514.  
  6515.     Now, you need to "compile" your ASCII help file into an indexed file.
  6516.     There is utility, MAKEINDX.COM, which takes your ASCII help file as
  6517.     input, and outputs an indexed version of of the same file.  This new
  6518.     file is the actual help file that you specify in the whelpdef()
  6519.     function.  Keep the ASCII help file around so you will be able to make
  6520.     modifications.
  6521.  
  6522.     ------------------------------------------------------------------------
  6523.  
  6524.     NAME
  6525.         whelpcat
  6526.  
  6527.     DESCRIPTION
  6528.         Sets the current help category.  If a window is active at the time,
  6529.         it will also set that window's help category.  The help category set
  6530.         by calling this function is what will be used by the help processor
  6531.         for searching the help file for help text.
  6532.  
  6533.     SYNOPSIS
  6534.         #include "cxlwin.h"
  6535.         int whelpcat(int cat);
  6536.  
  6537.  
  6538.  
  6539.                                      102
  6540.  
  6541.  
  6542.     INPUTS
  6543.         cat - help category number.
  6544.  
  6545.     RETURN VALUE
  6546.         W_NOERROR  - no error
  6547.         W_NOHLPDEF - no help record defined
  6548.  
  6549.     ALSO SEE
  6550.         whelpclr  whelpdef  whelpop  whelppcat  whelpush
  6551.  
  6552.     ------------------------------------------------------------------------
  6553.  
  6554.     NAME
  6555.         whelpclr
  6556.  
  6557.     DESCRIPTION
  6558.         Clears the help category stack.
  6559.  
  6560.     SYNOPSIS
  6561.         #include "cxlwin.h"
  6562.         int whelpclr(void);
  6563.  
  6564.     RETURN VALUE
  6565.         W_NOERROR  - no error
  6566.         W_NOHLPDEF - no help defined
  6567.  
  6568.     ALSO SEE
  6569.         whelpdef  whelpcat  whelpop  whelpush
  6570.  
  6571.     ------------------------------------------------------------------------
  6572.  
  6573.     NAME
  6574.         whelpdef
  6575.  
  6576.     DESCRIPTION
  6577.         Defines the help file, key, and window colors.  After calling this
  6578.         function, anytime the help key is pressed, the help processor will
  6579.         search the help file for whatever the current help category is.
  6580.  
  6581.     SYNOPSIS
  6582.         #include "cxlwin.h"
  6583.         int whelpdef(char *file,unsigned key,int winattr,int textattr,
  6584.                      int selattr,int barattr,void (*open)(void));
  6585.  
  6586.     INPUTS
  6587.         file     - address of string containing help file name.
  6588.         key      - keycode of key to be used for help key.  See Appendix B
  6589.                    for a list of keycodes that you can use.
  6590.         winattr  - attribute of the help window.
  6591.         textattr - attribute of the text in the help window.
  6592.         selattr  - attribute of the cross-reference selection text.
  6593.         barattr  - attribute of the cross-reference selection bar.
  6594.         open     - address of the function to call immediately upon opening
  6595.                    of the help window.  This can be used to call a function
  6596.  
  6597.  
  6598.  
  6599.                                      103
  6600.  
  6601.  
  6602.                    that could add a window shadow, etc.  If you do not need
  6603.                    to use this feature, specify NULL.
  6604.  
  6605.     RETURN VALUE
  6606.         W_NOERROR  - no error
  6607.         W_ALLOCERR - memory allocation error
  6608.         W_NOHLPDEF - you specified NULL for the help file name
  6609.  
  6610.     ALSO SEE
  6611.         whelpcat  whelpundef  whelpwin
  6612.  
  6613.     EXAMPLE
  6614.         whelpdef("CXLDEMO.HLP",0x3b00,LCYAN|_BLUE,GREEN|_BLUE,LGREEN|_BLUE
  6615.             ,BLUE|_LGREY,NULL);
  6616.  
  6617.     ------------------------------------------------------------------------
  6618.  
  6619.     NAME
  6620.         whelpop
  6621.  
  6622.     DESCRIPTION
  6623.         Pops the help category off of the top of the stack and makes it the
  6624.         current help category.
  6625.  
  6626.     SYNOPSIS
  6627.         #include "cxlwin.h"
  6628.         int whelpop(void);
  6629.  
  6630.     RETURN VALUE
  6631.         W_NOERROR  - no error
  6632.         W_NOHLPDEF - no defined help, see whelpdef().
  6633.         W_HLPSTKUN - help stack underflow (stack empty).
  6634.  
  6635.     ALSO SEE
  6636.         whelpcat  whelpclr  whelpdef  whelpopc  whelpush  whelpushc
  6637.  
  6638.     ------------------------------------------------------------------------
  6639.  
  6640.     NAME
  6641.         whelpopc
  6642.  
  6643.     DESCRIPTION
  6644.         Pops the help category off of the top of the stack and into the
  6645.         void.  The current help category is not affected.
  6646.  
  6647.     SYNOPSIS
  6648.         #include "cxlwin.h"
  6649.         int whelpopc(void);
  6650.  
  6651.     RETURN VALUE
  6652.         W_NOERROR  - no error
  6653.         W_NOHLPDEF - no defined help, see whelpdef().
  6654.         W_HLPSTKUN - help stack underflow (stack empty).
  6655.  
  6656.  
  6657.  
  6658.  
  6659.                                      104
  6660.  
  6661.  
  6662.     ALSO SEE
  6663.         whelpcat  whelpclr  whelpdef  whelpop  whelpush  whelpushc
  6664.  
  6665.     ------------------------------------------------------------------------
  6666.  
  6667.     NAME
  6668.         whelppcat
  6669.  
  6670.     DESCRIPTION
  6671.         Pushes the current help category onto the help category stack, then
  6672.         sets the current help category to the specified help category.  It's
  6673.         effectively the same as doing a whelpush() followed by a whelpcat().
  6674.  
  6675.     SYNOPSIS
  6676.         #include "cxlwin.h"
  6677.         int whelppcat(int cat);
  6678.  
  6679.     INPUTS
  6680.         cat  - help category number of the help category you want to make
  6681.                the current help category.
  6682.  
  6683.     RETURN VALUE
  6684.         W_NOERROR  - no error
  6685.         W_NOHLPDEF - no help record defined
  6686.         W_HLPSTKOV - help stack overflow (stack full)
  6687.  
  6688.     ALSO SEE
  6689.         whelpcat  whelpush  whelpushc
  6690.  
  6691.     ------------------------------------------------------------------------
  6692.  
  6693.     NAME
  6694.         whelpush
  6695.  
  6696.     DESCRIPTION
  6697.         Pushes the current help category onto the help category stack.  The
  6698.         stack can hold up to 20 help categories.
  6699.  
  6700.     SYNOPSIS
  6701.         #include "cxlwin.h"
  6702.         int whelpush(void);
  6703.  
  6704.     RETURN VALUE
  6705.         W_NOERROR  - no error
  6706.         W_NOHLPDEF - no defined help.  See whelpdef().
  6707.         W_HLPSTKOV - help stack overflow (stack full).
  6708.  
  6709.     ALSO SEE
  6710.         whelpcat  whelpclr  whelpdef  whelpop  whelppcat  whelpushc
  6711.  
  6712.     ------------------------------------------------------------------------
  6713.  
  6714.     NAME
  6715.         whelpushc
  6716.  
  6717.  
  6718.  
  6719.                                      105
  6720.  
  6721.  
  6722.     DESCRIPTION
  6723.         Pushes the specified help category onto the help category stack.
  6724.         The current help category is not affected.  The stack can hold up to
  6725.         20 help categories.
  6726.  
  6727.     SYNOPSIS
  6728.         #include "cxlwin.h"
  6729.         int whelpushc(int cat);
  6730.  
  6731.     INPUTS
  6732.         cat - help category number to push onto help category stack.
  6733.  
  6734.     RETURN VALUE
  6735.         W_NOERROR  - no error
  6736.         W_NOHLPDEF - no defined help.  See whelpdef().
  6737.         W_HLPSTKOV - help stack overflow (stack full).
  6738.  
  6739.     ALSO SEE
  6740.         whelpclr  whelpdef  whelpop  whelpopc  whelppcat  whelpush
  6741.  
  6742.     ------------------------------------------------------------------------
  6743.  
  6744.     NAME
  6745.         whelpundef
  6746.  
  6747.     DESCRIPTION
  6748.         Disengages the help system.  This un-defines the help key, clears
  6749.         the help stack, and frees any memory allocated by the help system.
  6750.  
  6751.     SYNOPSIS
  6752.         #include "cxlwin.h"
  6753.         int whelpundef(void);
  6754.  
  6755.     RETURN VALUE
  6756.         W_NOERROR  - no error
  6757.         W_NOHLPDEF - no help defined.  See whelpdef().
  6758.  
  6759.     ALSE SEE
  6760.         whelpdef
  6761.  
  6762.     ------------------------------------------------------------------------
  6763.  
  6764.     NAME
  6765.         whelpwin
  6766.  
  6767.     DESCRIPTION
  6768.         Sets specific features to be used by the help window for when it
  6769.         opens. These are screen coordinates, border type, and whether or not
  6770.         to display a "Help" title on the upper window border. It does not
  6771.         actually open the help window.  You can call whelpwin() anytime
  6772.         after calling whelpdef().  You can call whelpwin() as often as you
  6773.         like during your program.
  6774.  
  6775.     SYNOPSIS
  6776.  
  6777.  
  6778.  
  6779.                                      106
  6780.  
  6781.  
  6782.         #include "cxlwin.h"
  6783.         int whelpwin(int srow,int scol,int erow,int ecol,int btype,
  6784.                      int title);
  6785.  
  6786.     INPUTS
  6787.         srow  - start row to be used for help window
  6788.         scol  - start column to be used for help window
  6789.         erow  - end row to be used for help window
  6790.         ecol  - end column to be used for help window
  6791.         btype - box type (0-5) to be used for help window
  6792.         title - display "Help" title on top border? (0=no, 1=yes)
  6793.  
  6794.     RETURN
  6795.         W_NOERROR  - no error
  6796.         W_NOHLPDEF - no help defined, see whelpdef()
  6797.  
  6798.     ALSO SEE
  6799.         whelpdef
  6800.  
  6801.     ------------------------------------------------------------------------
  6802.  
  6803.     NAME
  6804.         whide
  6805.  
  6806.     DESCRIPTION
  6807.         Hides the active window.  The next window becomes active.
  6808.  
  6809.     SYNOPSIS
  6810.         #include "cxlwin.h"
  6811.         int whide(void);
  6812.  
  6813.     RETURN VALUE
  6814.         W_NOERROR  - no error
  6815.         W_ALLOCERR - memory allocation error
  6816.         W_NOACTIVE - no active window
  6817.  
  6818.     ALSO SEE
  6819.         whandle  wunhide
  6820.  
  6821.     ------------------------------------------------------------------------
  6822.  
  6823.     NAME
  6824.         whline
  6825.  
  6826.     DESCRIPTION
  6827.         "Draws" a horizontal text line in active window using characters
  6828.         defined by given box type.  If horizontal line crosses a vertical
  6829.         line of the same box type, an appropriate intersection or corner
  6830.         will be used.
  6831.  
  6832.     SYNOPSIS
  6833.         #include "cxlwin.h"
  6834.         int whline(int wsrow,int wscol,int count,int btype,int attr);
  6835.  
  6836.  
  6837.  
  6838.  
  6839.                                      107
  6840.  
  6841.  
  6842.     INPUTS
  6843.         wsrow - window start row
  6844.         wscol - window start column
  6845.         count - number of line characters to display
  6846.         btype - box type.  Can be one of the following:
  6847.                     0 - single line
  6848.                     1 - double line
  6849.                     2 - single horz, double vert line
  6850.                     3 - double horz, single vert line
  6851.                     4 - thick line
  6852.                     5 - uses spaces for line chars
  6853.         attr  - text attribute to use for the line
  6854.  
  6855.     RETURN VALUE
  6856.         W_NOERROR   - no error
  6857.         W_NOACTIVE  - no active window
  6858.         W_INVCOORD  - text line too long for window
  6859.         W_INVBTYPE  - invalid box type
  6860.  
  6861.     ALSO SEE
  6862.         wvline
  6863.  
  6864.     EXAMPLE
  6865.         whline(1,0,5,LMAGENTA|_BLACK);
  6866.  
  6867.     ------------------------------------------------------------------------
  6868.  
  6869.     NAME
  6870.         windowat
  6871.  
  6872.     DESCRIPTION
  6873.         Returns the handle of the window at given screen row,column
  6874.         coordinates.
  6875.  
  6876.     SYNOPSIS
  6877.         #include "cxlwin.h"
  6878.         WINDOW windowat(int row,int col);
  6879.  
  6880.     INPUTS
  6881.         row - screen row
  6882.         col - screen column
  6883.  
  6884.     RETURN VALUE
  6885.         The window handle of the window found at given coordinates.  If an
  6886.         error occurred, zero will be returned and _winfo.errno will be set
  6887.         to one of the following:
  6888.             W_NOACTIVE - no active window
  6889.             W_NOTFOUND - no window found at given screen coordinates
  6890.  
  6891.     ALSO SEE
  6892.         whandle
  6893.  
  6894.     ------------------------------------------------------------------------
  6895.  
  6896.  
  6897.  
  6898.  
  6899.                                      108
  6900.  
  6901.  
  6902.     NAME
  6903.         windump
  6904.  
  6905.     DESCRIPTION
  6906.         Dumps a screen window to the printer (PRN).
  6907.  
  6908.     SYNOPSIS
  6909.         #include "cxlprn.h"
  6910.         void windump(int srow,int scol,int erow,int ecol);
  6911.  
  6912.     INPUTS
  6913.         srow - start row
  6914.         scol - start column
  6915.         erow - end row
  6916.         ecol - end column
  6917.  
  6918.     ALSO SEE
  6919.         wdump
  6920.  
  6921.     EXAMPLE
  6922.         windump(0,0,9,79);     /* prints top 10 lines of screen */
  6923.  
  6924.     ------------------------------------------------------------------------
  6925.  
  6926.     Multi-Field Input Functions
  6927.  
  6928.     Three functions are needed to process multi-field formatted input from
  6929.     windows:  winpbeg(), winpdef(), and winpread().  The winpbeg() function
  6930.     marks the start of an input form.  The winpdef() function defines an
  6931.     input field and is called for each input field to be defined. The
  6932.     winpread() function marks the end of the input form and processes all
  6933.     defined fields.  The formatted input capabilities are much like those of
  6934.     the inputsf() and winputsf() functions.  The major difference is that
  6935.     with the winpbeg()/winpdef()/winpread() combination, you can edit back
  6936.     and forth between fields before finally accepting the input.
  6937.  
  6938.     For every input field you want to define, you must call winpdef(). This
  6939.     will allocate memory to hold the input record information. The first two
  6940.     parameters, wrow and wcol, specify where in the active window the field
  6941.     will be loaded.
  6942.  
  6943.     The next parameter, str, is the address of the string buffer to receive
  6944.     the input data.  The edited string will be terminated with a '\0'.  This
  6945.     means if your format string is "AAAAA", your receiving field must be
  6946.     string[6] to hold the terminating '\0'.  You can edit numeric
  6947.     information as well. There are 4 conversion functions to convert numbers
  6948.     to/from CXL fields:
  6949.  
  6950.         cvtic() - convert integer to CXL field string
  6951.         cvtci() - convert CXL field string to integer
  6952.         cvtfc() - convert real number to CXL field string
  6953.         cvtcf() - convert CXL field string to real number
  6954.  
  6955.     The next parameter, format, is the input field format string. It
  6956.  
  6957.  
  6958.  
  6959.                                      109
  6960.  
  6961.  
  6962.     controls how each character is input and how large the input field will
  6963.     be.  It consists of 1 or more format characters, and may have displayed
  6964.     text in between any of the format control characters.  You may use
  6965.     spaces in between the format control characters for readability.  Valid
  6966.     format control characters are listed in the "Formatted Keyboard Input
  6967.     Functions" section.  The case of the format control characters must be
  6968.     as shown.  You can also specify a decimal point in the field.  Format
  6969.     strings for winpdef() are just like those of inputsf() and winputsf()
  6970.     except there are no command toggles.
  6971.  
  6972.     The next parameter in the winpdef() function is fconv.  These are
  6973.     similar to the command toggles of inputsf() and winputsf() except that
  6974.     the fconv character applies conversion to the whole field.  Valid fconv
  6975.     characters are:
  6976.  
  6977.             0   - apply no conversion
  6978.             'L' - convert letters to lowercase
  6979.             'M' - convert letters to mixed upper & lowercase
  6980.             'P' - password field (do not echo characters)
  6981.             'U' - convert letters to uppercase
  6982.             '9' - numeric field (right justify, space fill to the left of
  6983.                   the decimal; and left justify, zero fill to the right of
  6984.                   the decimal.
  6985.  
  6986.     After the fconv parameter comes the mode parameter.  This parameter
  6987.     allows you to specify if the input field is going to create new data or
  6988.     update old data.  If the mode parameter is 0, then the input field
  6989.     will be used for entering new data. If the mode parameter is nonzero,
  6990.     then the input field will be used to update the old data contained in
  6991.     the str parameter.  If you specify 2 for mode, the cursor will appear
  6992.     at the end of the line and if an editing key is pressed first, the field
  6993.     will be used for updating, otherwise the field will be used to create
  6994.     new information.  If you do choose to update, then the length of the
  6995.     input str will be adjusted to the field size either by truncation or
  6996.     padding with spaces.
  6997.  
  6998.     The next parameter in the winpdef() function is validate.  This
  6999.     parameter is the address of an optional field validation function.  On
  7000.     exit of each field, winpread() will call this function to validate it.
  7001.     You can use this function for validating, modifying, displaying error
  7002.     messages, or just about anything.  This must function accept a pointer
  7003.     to char for input and return either 0 for no error, or the position in
  7004.     the field where the error occurred (starting with 1).  If no validation
  7005.     function is to be used, then specify NULL.  Here's an example field
  7006.     validation function that checks for embedded spaces:
  7007.  
  7008.         int check_field_for_embedded_spaces(char *input_field)
  7009.         {
  7010.             int current_position=1,error_position=0;
  7011.  
  7012.             /* search for end of text */
  7013.             while(*input_field++!=' ') current_position++;
  7014.             /* search to end of field for non-space characters */
  7015.             while(*input_field==' ') {
  7016.  
  7017.  
  7018.  
  7019.                                      110
  7020.  
  7021.  
  7022.                 current_position++;
  7023.                 input_field++;
  7024.             }
  7025.             /* if at not end of field, then field is invalid */
  7026.             if(*input_field!='\0') error_position=current_position;
  7027.             return(error_position);
  7028.         }
  7029.  
  7030.     The final parameter to winpdef(), help, is the help category number to
  7031.     assign to this menu item.  This is useful if you are using the
  7032.     context-sensitive help system and you want to assign a different help
  7033.     category to each field.  If you do not need to use this feature, specify
  7034.     0 for this parameter.
  7035.  
  7036.     The winpdef() function will return one of the following values:
  7037.  
  7038.         W_NOERROR  - no error
  7039.         W_NOACTIVE - no active window
  7040.         W_INVCOORD - invalid coordinates
  7041.         W_ALLOCERR - memory allocation error
  7042.         W_NOFRMBEG - no begin of form specified (winpbeg() not called)
  7043.         W_INVFORMT - invalid format string (syntax error)
  7044.  
  7045.     Once you have defined all input fields with winpdef(), you call
  7046.     winpread() to process them.  The user is allowed to move around and edit
  7047.     all of the fields.  The input fields are validated on the fly and after
  7048.     entering the last field.  Valid editing keys are listed in Appendix E.
  7049.  
  7050.     After the winpread() function returns, all fields defined with winpdef()
  7051.     will be cleared.  The receiving strings of all defined fields will now
  7052.     contain the data entered.  If Escape checking was on and [Esc] was
  7053.     pressed, then all receiving strings will contain the values they held
  7054.     before winpread() was called and W_ESCPRESS will be returned.
  7055.  
  7056.     The general structure for defining input fields looks like:
  7057.  
  7058.         winpbeg(...);
  7059.         winpdef(...);
  7060.         winpdef(...);
  7061.         winpdef(...);
  7062.         winpread();
  7063.  
  7064.     Sometimes, you may have a need to extend or modify the data entry keys used
  7065.     by winpread() during processing of the fields.   There is a function,
  7066.     winpkey(), that enables this.  What winpkey() does is defines a function
  7067.     to be used as the alternate get-key function so that during winpread()
  7068.     processing you can get a key, test it, change it, or do whatever else
  7069.     you like with it before you return it to winpread().  It also lets you
  7070.     to specify a variable to receive the key that caused termination of the
  7071.     form.  The call to winpkey() can be contained anywhere between winpbeg()
  7072.     and winpread().
  7073.  
  7074.     Often, when dealing with database records, users would like to have
  7075.     [PgUp] mean previous record and [PgDn] mean next record.  Let's also say
  7076.  
  7077.  
  7078.  
  7079.                                      111
  7080.  
  7081.  
  7082.     that we want to use [F10] as the normal exit key instead of the
  7083.     currently defined [Ctrl-Enter].  Here is an example of an alternate
  7084.     get-key function would handle this:
  7085.  
  7086.         unsigned get_key(int *done)
  7087.         {
  7088.             unsigned int key;
  7089.  
  7090.             key=getxch();
  7091.             /* if key was [F10], change it to [Ctrl-Enter] */
  7092.             if(key=0x4400) key=0x1c0a;
  7093.             /* if key was [PgUp] or [PgDn], set done flag on */
  7094.             if(key==0x4900 || key==0x5100) *done=TRUE;
  7095.             return(key);
  7096.         }
  7097.  
  7098.     In your code, where you define your form, you use winpkey() to tell CXL
  7099.     of the alternate get-key function's existance and specify which variable
  7100.     to hold the keypress of the termination key.  Here's something how it
  7101.     would look in your program:
  7102.  
  7103.         unsigned key_that_terminated_form;
  7104.         /*...define window, begin of form, and all fields...*/
  7105.         winpkey(get_key,&key_that_terminated_form);
  7106.         winpread();
  7107.         switch(key_that_terminated_form) {
  7108.             case 0x4900:
  7109.                 /* [PgUp] */
  7110.             case 0x5100:
  7111.                 /* [PgDn] */
  7112.             case 0x1c0d:
  7113.             case 0x1c0a:
  7114.                 /* [Enter] or [Ctrl-Enter] (aka [F10]) */
  7115.             case 0x011b:
  7116.                 /* [Esc] */
  7117.         }
  7118.  
  7119.     ------------------------------------------------------------------------
  7120.  
  7121.     NAME
  7122.         winpbeg
  7123.  
  7124.     DESCRIPTION
  7125.         Marks the beginning of a data input form, and specifies text
  7126.         attributes to be used by the form.
  7127.  
  7128.     SYNOPSIS
  7129.         #include "cxlwin.h"
  7130.         int winpbeg(int fieldattr,int textattr);
  7131.  
  7132.     INPUTS
  7133.         fieldattr - field attribute
  7134.         textattr  - text attribute
  7135.  
  7136.  
  7137.  
  7138.  
  7139.                                      112
  7140.  
  7141.  
  7142.     RETURN VALUE
  7143.         W_NOERROR  - no error
  7144.         W_ALLOCERR - memory allocation error
  7145.         W_NOACTIVE - no active window
  7146.  
  7147.     ALSO SEE
  7148.         winpdef  winpread
  7149.  
  7150.     ------------------------------------------------------------------------
  7151.  
  7152.     NAME
  7153.         winpdef
  7154.  
  7155.     DESCRIPTION
  7156.         Defines a window input field.
  7157.  
  7158.     SYNOPSIS
  7159.         #include "cxlwin.h"
  7160.         int winpdef(int wrow,int wcol,char *str,char *format,int fconv,
  7161.                     int mode,int (*validate) (char *),int help);
  7162.  
  7163.     INPUTS
  7164.         wrow     - start of input, window's row coordinate
  7165.         wcol     - start of input, window's column coordinate
  7166.         str      - address of string buffer to receive input
  7167.         format   - address of field format string.  See Appendix D for valid
  7168.                    format string characters.
  7169.         fconv    - input field conversion character.  Applies conversion to
  7170.                    all characters in the input field. Can be one of the
  7171.                    following:
  7172.                        0   - apply no conversion
  7173.                        'L' - convert letters to lowercase
  7174.                        'M' - convert letters to mixed case
  7175.                        'P' - password field (no echo)
  7176.                        'U' - convert letters to uppercase
  7177.                        '9' - numeric field
  7178.         mode     - field mode
  7179.                        0 - initial data entry
  7180.                        1 - update existing data
  7181.                        2 - conditional update
  7182.         validate - address of your user validation/modification function.
  7183.                    If you do not wish to have a field validation function,
  7184.                    then specify NULL.
  7185.         help     - help category number to be associated with this input
  7186.                    field. Specify 0 if no help category is to be assigned.
  7187.  
  7188.     RETURN VALUE
  7189.         W_NOERROR  - no error
  7190.         W_ALLOCERR - memory allocation error
  7191.         W_NOFRMBEG - no begin of form specified, see winpbeg()
  7192.         W_INVCOORD - invalid coordinates
  7193.         W_INVFORMT - invalid format string
  7194.  
  7195.     ALSO SEE
  7196.  
  7197.  
  7198.  
  7199.                                      113
  7200.  
  7201.  
  7202.         winpbeg  winpread
  7203.  
  7204.     ------------------------------------------------------------------------
  7205.  
  7206.     NAME
  7207.         winpfba
  7208.  
  7209.     DESCRIPTION
  7210.         Assigns "before" and "after" function pointers to the input field
  7211.         just defined.  The call to this function must appear immediately
  7212.         after the call to the winpdef() to which it relates.  During user
  7213.         input, when the user enters the field, the before function gets
  7214.         called.  When the user leaves the validated field, the after
  7215.         function gets called.  This powerful feature allows you to do some
  7216.         pretty advanced stuff with input fields, but must be used very
  7217.         carefully.
  7218.  
  7219.     SYNOPSIS
  7220.         #include "cxlwin.h"
  7221.         int winpfba(void (*before)(void),void (*after)(void));
  7222.  
  7223.     INPUTS
  7224.         before - address of the before function.  If you do not wish to
  7225.                  define a before function, specify NULL.
  7226.         after  - address of the after function.  If you do not wish to
  7227.                  define an after function, specify NULL.
  7228.  
  7229.     RETURN VALUE
  7230.         W_NOERROR  - no error
  7231.         W_NOACTIVE - no active window
  7232.         W_NOFRMBEG - no begin of form defined.  See winpbeg().
  7233.         W_NOINPDEF - no input fields defined.  See winpdef().
  7234.  
  7235.     ALSO SEE
  7236.         winpbeg  winpdef  winpread
  7237.  
  7238.     ------------------------------------------------------------------------
  7239.  
  7240.     NAME
  7241.         winpfcurr
  7242.  
  7243.     DESCRIPTION
  7244.         Returns the address of the current input field's record.  After the
  7245.         call to this function, you may access any of the current input
  7246.         field's elements.  See the definition of struct _field_t in the
  7247.         CXLWIN.H file for all of the elements you may use.  Use caution when
  7248.         updating elements in the field's record.  This function should only
  7249.         be called while the input form to which it relates is being
  7250.         processed.
  7251.  
  7252.     SYNOPSIS
  7253.         #include "cxlwin.h"
  7254.         struct _field_t *winpfcurr(void);
  7255.  
  7256.  
  7257.  
  7258.  
  7259.                                      114
  7260.  
  7261.  
  7262.     RETURN VALUE
  7263.         The address of the current input field's record.  You can access
  7264.         individual elements of the field's record by using this address and
  7265.         the C pointer operator "->".  This function is a macro with no error
  7266.         checking, and will most likely return an invalid value if there
  7267.         isn't an active form.
  7268.  
  7269.     ALSO SEE
  7270.         winpbeg  winpdef  winpffind  winpread
  7271.  
  7272.     EXAMPLE
  7273.         printf("Length of current input field is:  %d\n"
  7274.             ,winpfcurr()->lenfld);
  7275.  
  7276.     ------------------------------------------------------------------------
  7277.  
  7278.     NAME
  7279.         winpffind
  7280.  
  7281.     DESCRIPTION
  7282.         Searches for a defined field whose window coordinates match the
  7283.         input coordinates, then returns the address of the field's record.
  7284.         After the call to this function, you may access any of the found
  7285.         input field's elements.  See the definition of struct _field_t in
  7286.         the CXLWIN.H file for all of the elements you may use.  Use caution
  7287.         when updating elements in the field's record.  This function should
  7288.         only be called during the processing of the input form to which it
  7289.         relates.
  7290.  
  7291.     SYNOPSIS
  7292.         #include "cxlwin.h"
  7293.         struct _field_t *winpffind(int wrow,int wcol);
  7294.  
  7295.     INPUTS
  7296.         wrow - window row of field to search for
  7297.         wcol - window column of field to search for
  7298.  
  7299.     RETURN VALUE
  7300.         The address of the found field's record.  You can access individual
  7301.         elements of the field's record by using this address and the C
  7302.         pointer operator "->".  If an error occurred, then NULL will be
  7303.         returned and _winfo.errno will be set to one of the following
  7304.         values:
  7305.             W_NOACTIVE - no active window
  7306.             W_NOFRMDEF - no form defined.  See winpbeg().
  7307.             W_NOTFOUND - no defined field matches input window coordinates
  7308.  
  7309.     ALSO SEE
  7310.         winpbeg  winpdef  winpfcurr  winpread
  7311.  
  7312.     ------------------------------------------------------------------------
  7313.  
  7314.     NAME
  7315.         winpkey
  7316.  
  7317.  
  7318.  
  7319.                                      115
  7320.  
  7321.  
  7322.     DESCRIPTION
  7323.         Allows you to extend or modify the data entry keys used as the
  7324.         alternate get-key function so that during winpread() processing you
  7325.         can get a key, test it, change it, or do whatever else you like with
  7326.         it before you return it to winpread().  It also lets you specify a
  7327.         variable to receive the key that caused termination of the form. The
  7328.         call to winpkey() can be contained anywhere between winpbeg() and
  7329.         winpread().
  7330.  
  7331.     SYNOPSIS
  7332.         #include "cxlwin.h"
  7333.         int winpkey(unsigned (*getkey)(int *),unsigned *termkey);
  7334.  
  7335.     INPUTS
  7336.         getkey  - address of the function to be used as the alternate
  7337.                   get-key function.
  7338.         termkey - address of the unsigned integer which will receive
  7339.                   the keycode of the key that will terminate the form.
  7340.  
  7341.     RETURN VALUE
  7342.         W_NOERROR  - no error
  7343.         W_NOACTIVE - no active form
  7344.         W_NOFRMBEG - no begin of form specified.  See winpbeg().
  7345.  
  7346.     ALSO SEE
  7347.         winpread
  7348.  
  7349.     ------------------------------------------------------------------------
  7350.  
  7351.     NAME
  7352.         winpread
  7353.  
  7354.     DESCRIPTION
  7355.         Marks the end of the defined input form and initiates processing of
  7356.         the defined input fields.  The user is allowed to edit back and
  7357.         forth between the defined fields until the last field is entered.
  7358.         Valid editing keys are listed in Appendix E.
  7359.  
  7360.     SYNOPSIS
  7361.         #include "cxlwin.h"
  7362.         int winpread(void);
  7363.  
  7364.     RETURN VALUE
  7365.         W_NOERROR  - no error
  7366.         W_NOACTIVE - no active window
  7367.         W_ESCPRESS - [Esc] key was pressed (only if Escape checking was on)
  7368.         W_NOINPDEF - no input fields defined
  7369.  
  7370.     ALSO SEE
  7371.         winpdef  winpkey  wsetesc
  7372.  
  7373.     ------------------------------------------------------------------------
  7374.  
  7375.     NAME
  7376.  
  7377.  
  7378.  
  7379.                                      116
  7380.  
  7381.  
  7382.         winputsf
  7383.  
  7384.     DESCRIPTION
  7385.         Inputs a formatted string from the keyboard.  Typed-in characters
  7386.         will be echoed to the active window in the current text attribute.
  7387.         This function provides an extremely powerful method of accept
  7388.         single-line input from the user.  You can limit input characters to
  7389.         certain characters of a type, such as numbers, insert strings in
  7390.         between typed in characters, create custom prompts, disable [Enter]
  7391.         until the field is filled, and more.  Provides Escape checking.
  7392.         Updates cursor position.
  7393.  
  7394.     SYNOPSIS
  7395.         #include "cxlwin.h"
  7396.         int winputsf(char *str,char *fmt);
  7397.  
  7398.     INPUTS
  7399.         str - address of the allocated space to receive string
  7400.         fmt - address of the format string.  See Appendix D for valid format
  7401.               string characters.
  7402.  
  7403.     RETURN VALUE
  7404.         W_NOERROR  - no error
  7405.         W_NOACTIVE - no active window
  7406.         W_ESCPRESS - [Esc] key was pressed
  7407.         W_INVFORMT - invalid format string
  7408.  
  7409.     ALSO SEE
  7410.         wgetns  wgets  wscanf  wsetesc  wtextattr
  7411.  
  7412.     EXAMPLE
  7413.         char buf[10];
  7414.         if(winputsf(buf,"'Enter phone nr:  '!R--!'('!+!###!-!') '!+!###"
  7415.             "!-!'-'!+!####")) wprintf("Error:  %s\n",werrmsg());
  7416.  
  7417.     ------------------------------------------------------------------------
  7418.  
  7419.     NAME
  7420.         winsline
  7421.  
  7422.     DESCRIPTION
  7423.         Inserts a blank line in the active window.  Depending upon the input
  7424.         scroll direction, lines will shift up or down to make room for the
  7425.         new line.
  7426.  
  7427.     SYNOPSIS
  7428.         #include "cxlwin.h"
  7429.         int winsline(int wrow,int direc);
  7430.  
  7431.     INPUTS
  7432.         wrow  - window row to insert at
  7433.         direc - scroll direction:
  7434.                     D_UP   - scroll up
  7435.                     D_DOWN - scroll down
  7436.  
  7437.  
  7438.  
  7439.                                      117
  7440.  
  7441.  
  7442.     RETURN VALUE
  7443.         W_NOERROR  - no error
  7444.         W_NOACTIVE - no active window
  7445.         W_INVCOORD - invalid window row
  7446.  
  7447.     ALSO SEE
  7448.         wdelline  wscroll
  7449.  
  7450.     ------------------------------------------------------------------------
  7451.  
  7452.     NAME
  7453.         wintodisk
  7454.  
  7455.     DESCRIPTION
  7456.         Copies a window of the screen to a disk file.
  7457.  
  7458.     SYNOPSIS
  7459.         #include "cxlvid.h"
  7460.         int wintodisk(int srow,int scol,int erow,int ecol,char *fname);
  7461.  
  7462.     INPUTS
  7463.         srow  - start row of window
  7464.         scol  - start column of window
  7465.         erow  - end row of window
  7466.         ecol  - end column of window
  7467.         fname - address of the string containing the filename of the file to
  7468.                 write to
  7469.  
  7470.     RETURN VALUE
  7471.         Nonzero if an error occurred.
  7472.  
  7473.     ALSO SEE
  7474.         disktoscrn  disktowin  scrntodisk
  7475.  
  7476.     EXAMPLE
  7477.         wintodisk(10,10,20,40,"WINDOW.SAV");
  7478.  
  7479.     ------------------------------------------------------------------------
  7480.  
  7481.     NAME
  7482.         wisactiv
  7483.  
  7484.     DESCRIPTION
  7485.         Determines if the specified window is active.
  7486.  
  7487.     SYNOPSIS
  7488.         #include "cxlwin.h"
  7489.         int wisactiv(WINDOW whandle);
  7490.  
  7491.     INPUTS
  7492.         whandle - the window handle of the window to check.
  7493.  
  7494.     RETURN VALUE
  7495.         Nonzero if specified window is active.
  7496.  
  7497.  
  7498.  
  7499.                                      118
  7500.  
  7501.  
  7502.     ALSO SEE
  7503.         wactiv  whandle
  7504.  
  7505.     ------------------------------------------------------------------------
  7506.  
  7507.     Bar Menu Functions
  7508.  
  7509.     To use CXL's menuing system, you must be familiar with the process of
  7510.     defining menus.  There are several functions associated with the
  7511.     defining of menus.  These functions must appear in your source code in a
  7512.     certain order.  Menu structures can be defined as simple as a one-level
  7513.     pop-up menu, or as complex as a multi-level pull-down menu system.  The
  7514.     basic format of all menu structures is:
  7515.  
  7516.         <wmenubeg|wmenubegc>
  7517.             wmenuitem
  7518.                 [wmenuitxt]
  7519.                 [wmenuiba]
  7520.                 [<wmenubeg|wmenubegc>...]
  7521.             [wmenuitem...]
  7522.         wmenuend
  7523.         wmenuget
  7524.  
  7525.     Either wmenubeg() or wmenubegc() is required to mark the start of a
  7526.     menu, wmenuitem() is required to define menu items, wmenuend() is
  7527.     required to mark the end of a menu, and wmenuget() initiates user
  7528.     processing of the entire menu structure.
  7529.  
  7530.     Notice that you can also define entire menus underneath any individual
  7531.     menu item.  This allows you to easily create nested menus to aid in
  7532.     building complex pull-down and multi-layered menuing systems. There is
  7533.     no limit to how deep you can nest sub-menus, with the exception of
  7534.     available memory.
  7535.  
  7536.     When coding multi-level menu systems, it is a good idea to use indenting
  7537.     as shown above to help you distinguish which menu items and menu-ends go
  7538.     with which menu-begins.
  7539.  
  7540.     wmenuitxt() and wmenuiba() are optional functions.  They allow you to
  7541.     add specific features to a menu item.  If either of these 2 functions
  7542.     are used, they must immediately follow the call to wmenuitem() to which
  7543.     they pertain.
  7544.  
  7545.     After you define the menu structure and call wmenuget(), the user is
  7546.     allowed to make a selection.  The following editing keys may be used by
  7547.     the user when processing the menu:
  7548.  
  7549.         LeftArrow   - moves selection bar to item left.
  7550.         RightArrow  - moves selection bar to item right.
  7551.         UpArrow     - moves selection bar to item upwards.
  7552.         DownArrow   - moves selection bar to item downwards.  If the current
  7553.                       menu item has a pull-down menu attached, then it will
  7554.                       be opened for processing.
  7555.         Enter       - selects the item that the selection bar is on.  If
  7556.  
  7557.  
  7558.  
  7559.                                      119
  7560.  
  7561.  
  7562.                       selected item has a sub-menu attached, then processing
  7563.                       of that menu will begin.
  7564.         Home        - moves selection bar to upper-leftmost item.
  7565.         End         - moves selection bar to lower-rightmost item.
  7566.         Esc         - if Escape checking is on, and your are in the root
  7567.                       menu, pressing this cancels input and returns a -1. If
  7568.                       inside a sub-menu, then you will just back up to the
  7569.                       previous menu.
  7570.  
  7571.     You can also quick-select a menu item by pressing its highlighted
  7572.     selection character, unless this feature is disabled.
  7573.  
  7574.     CXL's menuing system also includes built-in mouse support.  If you want
  7575.     to use it, you need to call msinit() somewhere near the beginning of the
  7576.     program.  This will set the mouse support level to MS_KEYS, which allows
  7577.     the mouse to emulate cursor keys.  If you would like a point-and-shoot
  7578.     selection capability where the user moves the mouse cursor around then
  7579.     presses the button to select, you must set the mouse support level to
  7580.     MS_CURS or MS_FULL via mssupport().  In either method of mouse support,
  7581.     the left mouse button is equivalent to the [Enter] key, and the right
  7582.     mouse button is equivalent to the [Esc] key.
  7583.  
  7584.     Each menu item can have a function and/or sub-menu attached to it.  When
  7585.     the user selects the menu item, wmenuget() will first check for an
  7586.     attached sub-menu.  If one exists, it will be processed.  Then
  7587.     wmenuget() will check for a defined select function.  If one exists,
  7588.     then wmenuget() will call it.
  7589.  
  7590.     This gives you two ways to handle a user selection.   The first, as
  7591.     you've seen, is to have a function attached to the menu item.  For
  7592.     example, if the menu item is "(A)dd Record" and it has a select function
  7593.     called add_record(), then it will be called upon selecting that menu
  7594.     item.  The other way to handle a user selection is by using a
  7595.     switch/case to test the return value from wmenuget().  This will only
  7596.     work properly on single-level menus, but sometimes gives you more
  7597.     flexibility.
  7598.  
  7599.     ------------------------------------------------------------------------
  7600.  
  7601.     NAME
  7602.         wmenubeg
  7603.  
  7604.     DESCRIPTION
  7605.         Starts a menu/sub-menu definition and describes the window which the
  7606.         menu will reside in.  This does not actually open any windows or
  7607.         menus, just defines them.  This must be used in conjuction with
  7608.         wmenuitem() and wmenuend().  This is one of the 4 functions that are
  7609.         required to process a menu.
  7610.  
  7611.     SYNOPSIS
  7612.         #include "cxlwin.h"
  7613.         int wmenubeg(int srow,int scol,int erow,int ecol,int btype,
  7614.                      int battr,int wattr,void (*open)(void));
  7615.  
  7616.  
  7617.  
  7618.  
  7619.                                      120
  7620.  
  7621.  
  7622.     INPUTS
  7623.         srow  - screen start row of where menu's window will open
  7624.         scol  - screen start column of where menu's window will open
  7625.         erow  - screen end row of where menu's window will open
  7626.         ecol  - screen end column of where menu's window will open
  7627.         btype - border type.  Can be one of the following:
  7628.                     0 - single line
  7629.                     1 - double line
  7630.                     2 - single horizontal, double vertical line
  7631.                     3 - double horizontal, single vertical line
  7632.                     4 - thick line
  7633.                     5 - no border
  7634.         battr - attribute to be used for the menu window's border.  If
  7635.                 btype==5, then this value will be ignored.
  7636.         wattr - attribute to be used for the menu's window.
  7637.         open  - address of the function to call upon opening of the menu's
  7638.                 window.  If you want to add a title, shadow, etc. to the
  7639.                 menu's window after it opens, this lets you specify which
  7640.                 function to call to perform these tasks.  Specify NULL if
  7641.                 you don't want to use this feature.
  7642.  
  7643.     RETURN VALUE
  7644.         W_NOERROR  - no error
  7645.         W_NOITMDEF - no menu items defined
  7646.         W_ALLOCERR - memory allocation error
  7647.  
  7648.     ALSO SEE
  7649.         wmenubegc  wmenuitem  wmenuend  wmenuget
  7650.  
  7651.     EXAMPLE
  7652.         wmenubeg(2,10,9,18,0,YELLOW,_BLUE,NULL);
  7653.  
  7654.     ------------------------------------------------------------------------
  7655.  
  7656.     NAME
  7657.         wmenubegc
  7658.  
  7659.     DESCRIPTION
  7660.         Starts a menu/sub-menu definition.  This is used in place of
  7661.         wmenubeg(). This function differs from wmenubeg() in that when the
  7662.         user processes the defined menu, the menu will assume whatever the
  7663.         active window is at the time.
  7664.  
  7665.     SYNOPSIS
  7666.         #include "cxlwin.h"
  7667.         int wmenubegc(void);
  7668.  
  7669.     RETURN VALUE
  7670.         W_NOERROR  - no error
  7671.         W_NOITMDEF - no menu items defined
  7672.         W_ALLOCERR - memory allocation error
  7673.  
  7674.     ALSO SEE
  7675.         wmenubeg  wmenuitem  wmenuend  wmenuget
  7676.  
  7677.  
  7678.  
  7679.                                      121
  7680.  
  7681.  
  7682.     ------------------------------------------------------------------------
  7683.  
  7684.     NAME
  7685.         wmenuend
  7686.  
  7687.     DESCRIPTION
  7688.         Ends a menu/sub-menu definition and defines specific
  7689.         features/attributes of that menu.  This is one of the 4 functions
  7690.         that are required to process a menu.
  7691.  
  7692.     SYNOPSIS
  7693.         #include "cxlwin.h"
  7694.         int wmenuend(int taginit,int menutype,int barwidth,int textpos,
  7695.                      int textattr,int scharattr,int noselattr,int barattr);
  7696.  
  7697.     INPUTS
  7698.         taginit   - tag ID of the item that the selection bar will start at.
  7699.         menutype  - a mask which describes how the menu will act.  Two or
  7700.                     more menutypes can be combined using the bitwise OR
  7701.                     operator '|'. For example, if the menu you are defining
  7702.                     is to be a pull-down menu, and you want to disable quick
  7703.                     selection, then you would specify M_PD|M_NOQS.  Valid
  7704.                     menutypes are:
  7705.                         M_HORZ - horizontal menu
  7706.                         M_VERT - vertical menu
  7707.                         M_OMNI - omnidirectional menu
  7708.                         M_PD   - pull-down menu
  7709.                         M_SAVE - save last bar position
  7710.                         M_NOQS - disable quick selection
  7711.         barwidth  - width of the selection bar.  If zero is given, then the
  7712.                     selection bar will conform to the width of each menu
  7713.                     item. If a number greater than the width of the window
  7714.                     is given, then the barwidth will be adjusted to its
  7715.                     width.
  7716.         textpos   - offset position from the start of the selection bar that
  7717.                     the menu item text will start.  If barwidth==0, then
  7718.                     textpos is ignored.
  7719.         textattr  - attribute to be used for menu text
  7720.         scharattr - attribute to be used for the quick selection character
  7721.         noselattr - attribute to be used for nonselectable text
  7722.         barattr   - attribute to be used for the selection bar
  7723.  
  7724.     RETURN VALUE
  7725.         W_NOERROR  - no error
  7726.         W_NOITMDEF - no menu items defined
  7727.         W_INVTAGID - taginit was invalid.  It must match one of the tagids
  7728.                      in the current menu.
  7729.  
  7730.     ALSO SEE
  7731.         wmenubeg  wmenubegc  wmenuget  wmenuitem
  7732.  
  7733.     EXAMPLE
  7734.         wmenuend('F',M_VERT,20,2,YELLOW|_BLUE,LCYAN|_BLUE,LGREY|_BLUE
  7735.             ,BLUE|_LGREY);
  7736.  
  7737.  
  7738.  
  7739.                                      122
  7740.  
  7741.  
  7742.     ------------------------------------------------------------------------
  7743.  
  7744.     NAME
  7745.         wmenuget
  7746.  
  7747.     DESCRIPTION
  7748.         Processes the defined menu structure.  The user is allowed to move a
  7749.         selection bar around to the various menu items. If mouse support is
  7750.         on, then the user can use the mouse for selecting as well.  If
  7751.         sub-menus exists, then the user can select those also.  Escape
  7752.         checking is provided for when the user is in the root menu, however
  7753.         if the user is in a sub-menu, pressing [Esc] will always return to
  7754.         the next level up.  This is one of the 4 functions that are required
  7755.         to process a menu.
  7756.  
  7757.     SYNOPSIS
  7758.         #include "cxlwin.h"
  7759.         int wmenuget(void);
  7760.  
  7761.     RETURN VALUE
  7762.         The tag ID of the menu item that was selected in the root menu.  If
  7763.         an error occurred, then -1 will be returned and the global variable
  7764.         _winfo.errno will be set to one of the following:
  7765.             W_NOMNUDEF - no menu defined
  7766.             W_NOMNUEND - no end of menu specified. See wmenuend().
  7767.             W_ESCPRESS - the [Esc] key was pressed from the root menu
  7768.             W_ALLOCERR - memory allocation error
  7769.             W_INVCOORD - invalid coordinates
  7770.             W_INVBTYPE - invalid box type
  7771.  
  7772.     ALSO SEE
  7773.         wmenubeg  wmenubegc  wmenuend  wmenuitem  wsetesc
  7774.  
  7775.     ------------------------------------------------------------------------
  7776.  
  7777.     NAME
  7778.         wmenuiba
  7779.  
  7780.     DESCRIPTION
  7781.         Assigns "before" and "after" function pointers to the menu item just
  7782.         defined.  The call to this function must appear immediately after
  7783.         the call to the wmenuitem() to which it relates.  During the
  7784.         processing of the menu, when the user moves to the item, the before
  7785.         function gets called.  When the user leaves the item, the after
  7786.         function gets called. This powerful feature allows you to do some
  7787.         advanced stuff with menus, but must be used very carefully.  One
  7788.         possible use of wmenuiba() is to define a before function that opens
  7789.         a window and writes some text in it, and an after function which
  7790.         closes that window.  When the user moved to that menu item, the
  7791.         window would open up and display text, then when the user left that
  7792.         menu item, the window would automatically close.
  7793.  
  7794.     SYNOPSIS
  7795.         #include "cxlwin.h"
  7796.  
  7797.  
  7798.  
  7799.                                      123
  7800.  
  7801.  
  7802.         int wmenuiba(void (*before)(void),void (*after)(void));
  7803.  
  7804.     INPUTS
  7805.         before - address of the before function.  If you do not wish to
  7806.                  define a before function, specify NULL.
  7807.         after  - address of the after function.  If you do not wish to
  7808.                  define an after function, specify NULL.
  7809.  
  7810.     RETURN VALUE
  7811.         W_NOERROR  - no error
  7812.         W_NOITMDEF - no menu items defined.  See wmenuitem().
  7813.  
  7814.     ALSO SEE
  7815.         wmenubeg  wmenuend  wmenuget  wmenuitem  wmenuitxt
  7816.  
  7817.     ------------------------------------------------------------------------
  7818.  
  7819.     NAME
  7820.         wmenuicurr
  7821.  
  7822.     DESCRIPTION
  7823.         Returns the address of the current menu item's record. After this
  7824.         call, you may access any of the item's elements.  This function
  7825.         would most likely be called from a "select", "before", or "after"
  7826.         function.  See the struct _item_t definition in the CXLWIN.H file
  7827.         for all the elements you may use.
  7828.  
  7829.     SYNOPSIS
  7830.         #include "cxlwin.h"
  7831.         struct _item_t *wmenuicurr(void);
  7832.  
  7833.     RETURN VALUE
  7834.         The address of the current menu item's record.
  7835.  
  7836.     ALSO SEE
  7837.         wmenubeg  wmenuend  wmenuget  wmenuifind  wmenuitem  wmenumcurr
  7838.  
  7839.     EXAMPLE
  7840.         printf("The current menu item's tagid = %d\n",wmenuicurr()->tagid);
  7841.  
  7842.     ------------------------------------------------------------------------
  7843.  
  7844.     NAME
  7845.         wmenuidsab
  7846.  
  7847.     DESCRIPTION
  7848.         This function disables a menu item by making it nonselectable.  This
  7849.         function would most likely be called from a "select", "before", or
  7850.         "after" function. It will set a flag so that when the called
  7851.         function returns to the menu, the disabled menu item will be
  7852.         displayed in the text attribute defined for nonselectable text.
  7853.  
  7854.     SYNOPSIS
  7855.         #include "cxlwin.h"
  7856.  
  7857.  
  7858.  
  7859.                                      124
  7860.  
  7861.  
  7862.         int wmenuidsab(int tagid);
  7863.  
  7864.     INPUTS
  7865.         tagid  - the tag ID of the menu item to disable
  7866.  
  7867.     RETURN VALUE
  7868.         W_NOERROR  - no error
  7869.         W_NOMNUDEF - no menu defined
  7870.         W_NOTFOUND - tagid not found
  7871.  
  7872.     ALSO SEE
  7873.         wmenuienab  wmenuinext
  7874.  
  7875.     ------------------------------------------------------------------------
  7876.  
  7877.     NAME
  7878.         wmenuienab
  7879.  
  7880.     DESCRIPTION
  7881.         This function enables a menu item by making it selectable. This
  7882.         function would most likely be called from a "select", "before", or
  7883.         "after" function.  It will set a flag so that when the called
  7884.         function returns to the menu, the enabled menu item will be
  7885.         displayed in the text attribute defined for selectable text.
  7886.  
  7887.     SYNOPSIS
  7888.         #include "cxlwin.h"
  7889.         int wmenuienab(int tagid);
  7890.  
  7891.     INPUTS
  7892.         tagid  - the tag ID of the menu item to enable
  7893.  
  7894.     RETURN VALUE
  7895.         W_NOERROR  - no error
  7896.         W_NOMNUDEF - no menu defined
  7897.         W_NOTFOUND - tagid not found
  7898.  
  7899.     ALSO SEE
  7900.         wmenuidsab  wmenuinext
  7901.  
  7902.     ------------------------------------------------------------------------
  7903.  
  7904.     NAME
  7905.         wmenuifind
  7906.  
  7907.     DESCRIPTION
  7908.         Searches the menu tree structure for the record of the menu item
  7909.         matching the input tag identifier, then returns the found record's
  7910.         address.  After the call to this function, you may access any of the
  7911.         found menu item's elements.  See the definition of struct _item_t in
  7912.         the CXLWIN.H file for all of the elements you may use.  Use caution
  7913.         when updating elements in the menu item's record.  This function
  7914.         should only be called during the processing of the menu to which it
  7915.         relates.
  7916.  
  7917.  
  7918.  
  7919.                                      125
  7920.  
  7921.  
  7922.     SYNOPSIS
  7923.         #include "cxlwin.h"
  7924.         struct _item_t *wmenuifind(int tagid);
  7925.  
  7926.     INPUTS
  7927.         tagid - the tag identifier of the menu item to find
  7928.  
  7929.     RETURN VALUE
  7930.         The address of the found menu item's record.  You can access
  7931.         individual elements of the menu item's record by using this address
  7932.         and the C pointer operator "->".  If an error occurred, then NULL
  7933.         will be returned and _winfo.errno will be set to one of the
  7934.         following values:
  7935.             W_NOMNUDEF - no menu is defined.  See wmenubeg().
  7936.             W_NOTFOUND - input tag identifier not found
  7937.  
  7938.     ALSO SEE
  7939.         wmenubeg  wmenuend  wmenuget  wmenuicurr  wmenuitem
  7940.  
  7941.     ------------------------------------------------------------------------
  7942.  
  7943.     NAME
  7944.         wmenuinext
  7945.  
  7946.     DESCRIPTION
  7947.         Defines which menu item the selection bar will move to next.  This
  7948.         function would most likely be called from a "select", "before", or
  7949.         "after" function.  The selection bar does not actually move until
  7950.         the called function returns to the menu.
  7951.  
  7952.     SYNOPSIS
  7953.         #include "cxlwin.h"
  7954.         int wmenuinext(int tagid);
  7955.  
  7956.     INPUTS
  7957.         tagid  - the tag ID of the menu item that you want the selection bar
  7958.                  to move to.
  7959.  
  7960.     RETURN VALUE
  7961.         W_NOERROR   - no error
  7962.         W_NOMNUDEF  - no menu defined
  7963.         W_NOTFOUND  - tagid not found
  7964.  
  7965.     ALSO SEE
  7966.         wmenuidsab  wmenuienab
  7967.  
  7968.     ------------------------------------------------------------------------
  7969.  
  7970.     NAME
  7971.         wmenuitem
  7972.  
  7973.     DESCRIPTION
  7974.         Defines a menu item.  This is one of the 4 functions that are
  7975.         required to process a menu.
  7976.  
  7977.  
  7978.  
  7979.                                      126
  7980.  
  7981.  
  7982.     SYNOPSIS
  7983.         #include "cxlwin.h"
  7984.         int wmenuitem(int wrow,int wcol,char *str,int schar,int tagid,
  7985.                       int fmask,void (*select)(void),unsigned hotkey,
  7986.                       int help);
  7987.  
  7988.     INPUTS
  7989.         wrow   - window row
  7990.         wcol   - window column
  7991.         str    - address of menu item string
  7992.         schar  - quick selection character.  This is often the first letter
  7993.                  of the menu item.
  7994.         tagid  - unique tag identifier of this particular menu item.  This
  7995.                  is the value that wmenuget() returns upon its selection.
  7996.         fmask  - feature mask.  Allows you to define one or more additional
  7997.                  features for this menu item.  Valid features are:
  7998.                      M_HASPD - has a pull-down menu attached
  7999.                      M_NOSEL - menu item is not selectable
  8000.                      M_CLOSE - close this menu when item is selected. Menu's
  8001.                                window is closed after the selection function
  8002.                                returns.
  8003.                      M_CLOSB - close this menu when item is selected. Menu's
  8004.                                window is closed before the selection
  8005.                                function is called.
  8006.                      M_CLALL - close all menus when item is selected and the
  8007.                                selection function returns.
  8008.                  More than one feature can be specified by using the C
  8009.                  bitwise OR operator '|'.  For example, if this item has a
  8010.                  pull-down menu attached and it is not selectable, you would
  8011.                  specify (M_HASPD|M_NOSEL). Specify 0 if you don't want to
  8012.                  define an fmask for this item.
  8013.         select - address of the function to call upon selection of this menu
  8014.                  item.  Specify NULL if you don't want to define a select
  8015.                  function.
  8016.         hotkey - keycode of the key, which when pressed, will select this
  8017.                  menu item's function from anywhere within the menu
  8018.                  structure.  This allows the user to call this menu item's
  8019.                  select function even if not currently processing its menu.
  8020.                  See Appendix B for a list of keycodes that you can use.
  8021.                  Specify 0 if you don't want to define a hotkey.
  8022.         help   - help category number to be associated with this item.
  8023.                  Specify 0 is you don't want to define a help category for
  8024.                  this item.
  8025.  
  8026.     RETURN VALUE
  8027.         W_NOERROR  - no error
  8028.         W_NOMNUBEG - no begin of menu specified.  See wmenubeg().
  8029.         W_ALLOCERR - memory allocation error
  8030.  
  8031.     ALSO SEE
  8032.         wmenubeg  wmenubegc  wmenuend  wmenuget  wmenuicurr  wmenuitxt
  8033.  
  8034.     EXAMPLE
  8035.         wmenuitem(0,0,"Load   F3",'L',1,M_CLOSE,load_file,0x3d00,0);
  8036.  
  8037.  
  8038.  
  8039.                                      127
  8040.  
  8041.  
  8042.     ------------------------------------------------------------------------
  8043.  
  8044.     NAME
  8045.         wmenuitxt
  8046.  
  8047.     DESCRIPTION
  8048.         Adds a text description to a menu item.  You can use this function
  8049.         to create Lotus-style menus where the text descriptions are
  8050.         displayed underneath the menu and change each time the user moves to
  8051.         a new menu item.
  8052.  
  8053.     SYNOPSIS
  8054.         #include "cxlwin.h"
  8055.         int wmenuitxt(int wrow,int wcol,int attr,char *str);
  8056.  
  8057.     INPUTS
  8058.         wrow - window row
  8059.         wcol - window column
  8060.         attr - text attribute
  8061.         str  - address of description string
  8062.  
  8063.     RETURN VALUE
  8064.         W_NOERROR  - no error
  8065.         W_NOITMDEF - no menu items defined
  8066.  
  8067.     ALSO SEE
  8068.         wmenuiba  wmenuitem
  8069.  
  8070.     EXAMPLE
  8071.         wmenuitxt(1,0,LCYAN|_BLUE,"Quit program and return to DOS");
  8072.  
  8073.     ------------------------------------------------------------------------
  8074.  
  8075.     NAME
  8076.         wmenumcurr
  8077.  
  8078.     DESCRIPTION
  8079.         Returns the address of the currently active menu's record.  After
  8080.         this call, you may access any of the menu's elements.  See the
  8081.         definition of struct _menu_t in the CXLWIN.H file for all of the
  8082.         elements you may use. Use caution when updating elements in the
  8083.         menu's record. This function should only be called while the menu to
  8084.         which it relates is being processed.
  8085.  
  8086.     SYNOPSIS
  8087.         #include "cxlwin.h"
  8088.         struct _menu_t *wmenumcurr(void);
  8089.  
  8090.     RETURN VALUE
  8091.         The address of the current menu's record.  After you get this
  8092.         address, you can access the menu's elements via the C pointer
  8093.         operator "->". There is no error return value - if you call this
  8094.         function while not processing a menu, then you will more than likely
  8095.         get an invalid address.
  8096.  
  8097.  
  8098.  
  8099.                                      128
  8100.  
  8101.  
  8102.     ALSO SEE
  8103.         wmenubeg  wmenuend  wmenuget  wmenuicurr  wmenuitem
  8104.  
  8105.     ------------------------------------------------------------------------
  8106.  
  8107.     NAME
  8108.         wmessage
  8109.  
  8110.     DESCRIPTION
  8111.         Displays text on the top or bottom border of the active window.
  8112.  
  8113.     SYNOPSIS
  8114.         #include "cxlwin.h"
  8115.         int wmessage(char *str,int border,int leftofs,int attr);
  8116.  
  8117.     INPUTS
  8118.         str     - address of message string
  8119.         border  - window border code.  Can be one of the following:
  8120.                     TP_BORD - top border
  8121.                     BT_BORD - bottom border
  8122.         leftofs - offset from left border to display message at
  8123.         attr    - attribute of message text
  8124.  
  8125.     RETURN VALUE
  8126.         W_NOERROR  - no error
  8127.         W_NOACTIVE - no active window
  8128.         W_STRLONG  - string could not fit in window
  8129.         W_NOBORDER - window has no border
  8130.  
  8131.     ALSO SEE
  8132.         wbprintc  wtitle
  8133.  
  8134.     EXAMPLE
  8135.         wmessage("[ F1=Help ]",BT_BORD,2,YELLOW|_BLACK);
  8136.  
  8137.     ------------------------------------------------------------------------
  8138.  
  8139.     NAME
  8140.         wmove
  8141.  
  8142.     DESCRIPTION
  8143.         Moves the active window to a new location on the screen.
  8144.  
  8145.     SYNOPSIS
  8146.         #include "cxlwin.h"
  8147.         int wmove(int nsrow,int nscol);
  8148.  
  8149.     INPUTS
  8150.         nsrow - new starting row of window
  8151.         nscol - new starting column of window
  8152.  
  8153.     RETURN VALUE
  8154.         W_NOERROR  - no error
  8155.         W_ALLOCERR - memory allocation error
  8156.  
  8157.  
  8158.  
  8159.                                      129
  8160.  
  8161.  
  8162.         W_NOACTIVE - no active window
  8163.  
  8164.     ALSO SEE
  8165.         wcopy  wdrag  wsize  wslide
  8166.  
  8167.     ------------------------------------------------------------------------
  8168.  
  8169.     NAME
  8170.         wopen
  8171.  
  8172.     DESCRIPTION
  8173.         Opens a screen window and makes it active.  The cursor location will
  8174.         be initialized to window row 0, column 0.  The text attribute will
  8175.         be initialized to the same attribute as the window.  You can open as
  8176.         many windows as memory permits.
  8177.  
  8178.     SYNOPSIS
  8179.         #include "cxlwin.h"
  8180.         WINDOW wopen(int srow,int scol,int erow,int ecol,int btype,
  8181.                      int battr,int wattr);
  8182.  
  8183.     INPUTS
  8184.         srow  - starting row
  8185.         scol  - starting column
  8186.         erow  - ending row
  8187.         ecol  - ending column
  8188.         btype - box type.  Can be one of the following:
  8189.                     0 - single line border
  8190.                     1 - double line border
  8191.                     2 - single horz, double vert line border
  8192.                     3 - double horz, single vert line border
  8193.                     4 - thick line border
  8194.                     5 - no border (uses spaces for border chars).  A
  8195.                         borderless window has a greater effective window
  8196.                         area than a window with a border.
  8197.         battr - attribute of window's border.
  8198.         wattr - attribute of window (and initially the text)
  8199.  
  8200.     RETURN VALUE
  8201.         The window handle of the new window or a zero if an error occurred.
  8202.         If error, the global variable _winfo.errno will be set to one of the
  8203.         following:
  8204.             W_ALLOCERR - memory allocation error
  8205.             W_INVCOORD - invalid coordinates
  8206.             W_INVBTYPE - invalid box type
  8207.  
  8208.     ALSO SEE
  8209.         videoinit  wactiv  wclose  wcloseall  wfillch
  8210.  
  8211.     EXAMPLE
  8212.         wopen(10,10,20,40,0,LCYAN|_BLUE,LGREEN|_BLUE);
  8213.  
  8214.     ------------------------------------------------------------------------
  8215.  
  8216.  
  8217.  
  8218.  
  8219.                                      130
  8220.  
  8221.  
  8222.     NAME
  8223.         wperror
  8224.  
  8225.     DESCRIPTION
  8226.         Opens an error window, displays an error message, sounds a beep,
  8227.         waits for a keypress, then returns to caller.  The error window is
  8228.         opened in the general vicinity of the cursor position.
  8229.  
  8230.     SYNOPSIS
  8231.         #include "cxlwin.h"
  8232.         int wperror(char *message);
  8233.  
  8234.     INPUTS
  8235.         message - address of the string containing the error message
  8236.  
  8237.     RETURN VALUE
  8238.         W_NOERROR  - no error
  8239.         W_ALLOCERR - memory allocation error
  8240.         W_STRLONG  - error message string too long
  8241.  
  8242.     ALSO SEE
  8243.         werrmsg
  8244.  
  8245.     EXAMPLE
  8246.         wperror("Field cannot be blank!");
  8247.  
  8248.     ------------------------------------------------------------------------
  8249.  
  8250.     NAME
  8251.         wpgotoxy
  8252.  
  8253.     DESCRIPTION
  8254.         Sets cursor coordinates within the active window.  If cursor
  8255.         coordinates are out of the window, wpgotoxy() will try to wrap them
  8256.         around to fit in the window.
  8257.  
  8258.     SYNOPSIS
  8259.         #include "cxlwin.h"
  8260.         int wpgotoxy(int wrow,int wcol);
  8261.  
  8262.     INPUTS
  8263.         wrow - window row (Y coordinate)
  8264.         wcol - window column (X coordinate)
  8265.  
  8266.     RETURN VALUE
  8267.         W_NOERROR  - no error
  8268.         W_NOACTIVE - no active window
  8269.         W_INVCOORD - invalid coordinates
  8270.  
  8271.     ALSO SEE
  8272.         wgotoxy  wreadcur
  8273.  
  8274.     ------------------------------------------------------------------------
  8275.  
  8276.  
  8277.  
  8278.  
  8279.                                      131
  8280.  
  8281.  
  8282.     NAME
  8283.         wpickfile
  8284.  
  8285.     DESCRIPTION
  8286.         This function will open up a window and display as many
  8287.         file/directory names in it as it can.  The user can use a selection
  8288.         bar to move through the file/directory names and select one.  If all
  8289.         of the file/directory names cannot fit in the window, scrolling and
  8290.         paging is allowed.  If the user selects a directory, wpickfile()
  8291.         will change to that directory and display the list of
  8292.         files/directories in it.  After the selection is made, wpickfile()
  8293.         will return the complete path name of the selected file.
  8294.  
  8295.     SYNOPSIS
  8296.         #include "cxlwin.h"
  8297.         char *wpickfile(int srow,int scol,int erow,int ecol,int btype,
  8298.                         int bordattr,int winattr,int barattr,int title,
  8299.                         char *filespec,void (*open)(void));
  8300.  
  8301.     INPUTS
  8302.         srow     - start row of pick window
  8303.         scol     - start column of pick window
  8304.         erow     - end row of pick window
  8305.         ecol     - end column of pick window.  If ecol==-1, then the
  8306.                    window's width will conform to that of the longest
  8307.                    matching filename.
  8308.         btype    - window box type (0-5)
  8309.         bordattr - border attribute
  8310.         winattr  - window attribute
  8311.         barattr  - selection bar attribute
  8312.         title    - display filespec title on upper border?  (0=no, 1=yes)
  8313.         filespec - match filespec (ie. "*.*")
  8314.         open     - address of the function to call upon each opening of the
  8315.                    file pick window.  If you do not need to use this
  8316.                    feature, specify NULL.
  8317.  
  8318.     RETURN VALUE
  8319.         The address of the static string containing the full
  8320.         drive:path\filename string of the selected file. If an error
  8321.         occurred, NULL will be returned and _winfo.errno will be set to one
  8322.         of the following:
  8323.             W_ESCPRESS - the [Esc] key was pressed
  8324.             W_ALLOCERR - memory allocation error
  8325.             W_DOSERROR - DOS error (ie. invalid directory)
  8326.             W_INVCOORD - invalid window coordinates
  8327.             W_INVBTYPE - invalid box type
  8328.             W_STRLONG  - window not wide enough to hold largest file name
  8329.             W_NOMATCH  - no files matched input filespec
  8330.  
  8331.     ALSO SEE
  8332.         wpickstr  wsetesc
  8333.  
  8334.     EXAMPLE
  8335.         char *fname;
  8336.  
  8337.  
  8338.  
  8339.                                      132
  8340.  
  8341.  
  8342.         fname=wpickfile(10,10,20,65,0,LCYAN|_BLUE,CYAN|_BLUE,BLUE|_LGREY,1
  8343.             ,"*.*",NULL);
  8344.         printf("You selected:  %s\n",fname);
  8345.  
  8346.     ------------------------------------------------------------------------
  8347.  
  8348.     NAME
  8349.         wpickstr
  8350.  
  8351.     DESCRIPTION
  8352.         This function will open up a window and display as many of the input
  8353.         strings in it as it can.  The user can use a selection bar to move
  8354.         through the strings and select one.  If all of the strings cannot
  8355.         fit in the window, scrolling and paging is allowed. After the
  8356.         selection is made, wpickstr() will return the array subsript of the
  8357.         string that was selected.
  8358.  
  8359.     SYNOPSIS
  8360.         #include "cxlwin.h"
  8361.         int wpickstr(int srow,int scol,int erow,int ecol,int btype,
  8362.                      int bordattr,int winattr,int barattr,char *strarr[],
  8363.                      int initelem,void (*open)(void));
  8364.  
  8365.     INPUTS
  8366.         srow     - start row of pick window
  8367.         scol     - start column of pick window
  8368.         erow     - end row of pick window
  8369.         ecol     - end column of pick window.  If ecol==-1, then the
  8370.                    window's width will conform to that of the longest string
  8371.                    in the input array.
  8372.         btype    - window box type (0-5)
  8373.         bordattr - border attribute
  8374.         winattr  - window attribute
  8375.         barattr  - selection bar attribute
  8376.         strarr   - address of array of char pointers (strings) to select
  8377.                    from. The last pointer in the array MUST be NULL!
  8378.         initelem - element of string to initialize selection bar to.  If
  8379.                    given element is invalid, it will default to 0.
  8380.         open     - address of the function to call upon each opening of the
  8381.                    string pick window.  If you do not need to use this
  8382.                    feature, specify NULL.
  8383.  
  8384.     RETURN VALUE
  8385.         The array subscript of the selected string.  If an error occurred,
  8386.         then -1 will be returned and _winfo.errno will be set to one of the
  8387.         following:
  8388.             W_ESCPRESS - the [Esc] key was pressed
  8389.             W_INVCOORD - invalid window coordinates
  8390.             W_INVBTYPE - invalid box type
  8391.             W_STRLONG  - window not wide enough to hold largest file name
  8392.  
  8393.     ALSO SEE
  8394.         wpickfile  wselstr  wsetesc
  8395.  
  8396.  
  8397.  
  8398.  
  8399.                                      133
  8400.  
  8401.  
  8402.     EXAMPLE
  8403.         int i;
  8404.         char *days[]= { "Sunday","Monday","Tuesday","Wednesday","Thursday",
  8405.             "Friday","Saturday",NULL };
  8406.         i=wpickstr(10,10,14,-1,0,YELLOW,LCYAN|_BLUE,BLUE|_LGREY,days,0,
  8407.                    NULL);
  8408.         if(i!=-1) printf("You selected %s\n",days[i]);
  8409.  
  8410.     ------------------------------------------------------------------------
  8411.  
  8412.     NAME
  8413.         wprintc
  8414.  
  8415.     DESCRIPTION
  8416.         Displays a character in the active window.  Control characters are
  8417.         not recognized.  Cursor position is not updated.
  8418.  
  8419.     SYNOPSIS
  8420.         #include "cxlwin.h"
  8421.         int wprintc(int row,int col,int attr,int ch);
  8422.  
  8423.     INPUTS
  8424.         row  - window row to display character at
  8425.         col  - window column to display character at
  8426.         attr - text attribute for character
  8427.         ch   - character
  8428.  
  8429.     RETURN VALUE
  8430.         W_NOERROR  - no error
  8431.         W_NOACTIVE - no active window
  8432.         W_INVCOORD - invalid coordinates
  8433.  
  8434.     ALSO SEE
  8435.         wbprintc  wprints  wputc
  8436.  
  8437.     EXAMPLE
  8438.         wprintc(5,5,BLINK|LRED|_GREEN,'X');
  8439.  
  8440.     ------------------------------------------------------------------------
  8441.  
  8442.     NAME
  8443.         wprintf
  8444.  
  8445.     DESCRIPTION
  8446.         Displays a formatted string to the active window at the current
  8447.         cursor position.  Works like the standard printf() function does.
  8448.         Recognizes control characters.  Characters will be displayed in the
  8449.         attribute set by the wtextattr() function.  Updates cursor position.
  8450.         Also recognizes CXL Escape sequences.  See Appendix C for a list of
  8451.         valid Escape codes.
  8452.  
  8453.     SYNOPSIS
  8454.         #include "cxlwin.h"
  8455.         int wprintf(const char *format,...);
  8456.  
  8457.  
  8458.  
  8459.                                      134
  8460.  
  8461.  
  8462.     INPUTS
  8463.         format - address of the format string.  Refer to the your compiler's
  8464.                  run-time library reference manual for information on valid
  8465.                  format characters.
  8466.         ...    - any additional arguments
  8467.  
  8468.     RETURN VALUE
  8469.         W_NOERROR  - no error
  8470.         W_NOACTIVE - no active window
  8471.  
  8472.     ALSO SEE
  8473.         wputc  wputns  wputs  wtabwidth  wtextattr
  8474.  
  8475.     EXAMPLE
  8476.         int i=32767;
  8477.         double d=3.14159;
  8478.         char ch='X',*str="Hello, world";
  8479.         wprintf("i = %d, d = %f, ch = %c, str = %s\n",i,d,ch,str);
  8480.  
  8481.     ------------------------------------------------------------------------
  8482.  
  8483.     NAME
  8484.         wprints
  8485.  
  8486.     DESCRIPTION
  8487.         Displays a string in the active window.  Control characters are not
  8488.         recognized.  Cursor position is not updated.
  8489.  
  8490.     SYNOPSIS
  8491.         #include "cxlwin.h"
  8492.         int wprints(int wrow,int wcol,int attr,char *str);
  8493.  
  8494.     INPUTS
  8495.         wrow - window row to display string at
  8496.         wcol - window column to display string at
  8497.         attr - text attribute for displayed characters
  8498.         str  - address of string
  8499.  
  8500.     RETURN VALUE
  8501.         W_NOERROR  - no error
  8502.         W_NOACTIVE - no active window
  8503.         W_INVCOORD - invalid coordinates
  8504.         W_STRLONG  - string too long to fit on window line
  8505.  
  8506.     ALSO SEE
  8507.         wcenters  wprintsf  wputs  wrjusts  wwprints
  8508.  
  8509.     EXAMPLE
  8510.         wprints(10,15,BLINK|YELLOW|_BROWN,"Hello, world");
  8511.  
  8512.     ------------------------------------------------------------------------
  8513.  
  8514.     NAME
  8515.         wprintsf
  8516.  
  8517.  
  8518.  
  8519.                                      135
  8520.  
  8521.  
  8522.     DESCRIPTION
  8523.         Displays a string to active window using a CXL format string.  If a
  8524.         character in a string doesn't match its format control character, it
  8525.         will be displayed as a '?'.  Control characters are not recognized.
  8526.         Cursor position is not updated.
  8527.  
  8528.     SYNOPSIS
  8529.         #include "cxlwin.h"
  8530.         int wprintsf(int wrow,int wcol,int attr,char *format,char *str);
  8531.  
  8532.     INPUTS
  8533.         wrow   - window row
  8534.         wcol   - window column
  8535.         attr   - text attribute
  8536.         format - address of format string.  Valid format string characters
  8537.                  are listed in Appendix D.
  8538.         str    - address of the string to display.
  8539.  
  8540.     RETURN VALUE
  8541.         W_NOERROR  - no error
  8542.         W_NOACTIVE - no active window
  8543.         W_INVFORMT - invalid format string
  8544.         W_STRLONG  - there were more characters in the display string than
  8545.                      the format string would display.
  8546.  
  8547.     ALSO SEE
  8548.         wprints
  8549.  
  8550.     EXAMPLE
  8551.         char str1[]="5125900460",str2[]="(512) 590-2910";
  8552.         wprintsf(3,5,LGREEN|_GREEN,"'('###') '###'-'####",str1);
  8553.         wprintsf(4,5,LGREEN|_GREEN,"##############",str2);
  8554.  
  8555.     ------------------------------------------------------------------------
  8556.  
  8557.     NAME
  8558.         wputc
  8559.  
  8560.     DESCRIPTION
  8561.         Displays a character in the active window at current cursor position
  8562.         using current text attribute.  Recognizes control characters.
  8563.         Updates cursor position.
  8564.  
  8565.     SYNOPSIS
  8566.         #include "cxlwin.h"
  8567.         int wputc(int ch);
  8568.  
  8569.     INPUTS
  8570.         ch - the character to be displayed
  8571.  
  8572.     RETURN VALUE
  8573.         W_NOERROR  - no error
  8574.         W_NOACTIVE - no active window
  8575.  
  8576.  
  8577.  
  8578.  
  8579.                                      136
  8580.  
  8581.  
  8582.     ALSO SEE
  8583.         wdupc  wprintc  wprintf  wtabwidth  wtextattr
  8584.  
  8585.     ------------------------------------------------------------------------
  8586.  
  8587.     NAME
  8588.         wputns
  8589.  
  8590.     DESCRIPTION
  8591.         Displays a string in the active window at the current cursor
  8592.         location using current text attribute.  The input width will
  8593.         determine how many characters are actually displayed.  Padding with
  8594.         spaces or truncating of output will be used where neccessary.
  8595.         Recognizes control characters. Updates cursor position.
  8596.  
  8597.     SYNOPSIS
  8598.         #include "cxlwin.h"
  8599.         int wputns(char *str,int width);
  8600.  
  8601.     INPUTS
  8602.         str   - address of the string to print
  8603.         width - width to display output string at
  8604.  
  8605.     RETURN VALUE
  8606.         W_NOERROR  - no error
  8607.         W_NOACTIVE - no active window
  8608.  
  8609.     ALSO SEE
  8610.         wprintf  wputs  wtextattr
  8611.  
  8612.     EXAMPLE
  8613.         wputns("Hello, world",5);
  8614.  
  8615.     ------------------------------------------------------------------------
  8616.  
  8617.     NAME
  8618.         wputs
  8619.  
  8620.     DESCRIPTION
  8621.         Displays a string in the active window at the current cursor
  8622.         position using current text attribute.  Recognizes control
  8623.         characters.  Updates cursor position.  Also recognizes CXL Escape
  8624.         sequences.  See Appendix C for a list of valid Escape codes.
  8625.  
  8626.     SYNOPSIS
  8627.         #include "cxlwin.h"
  8628.         int wputs(char *str);
  8629.  
  8630.     INPUTS
  8631.         str - the address of the string to display
  8632.  
  8633.     RETURN VALUE
  8634.         W_NOERROR  - no error
  8635.         W_NOACTIVE - no active window
  8636.  
  8637.  
  8638.  
  8639.                                      137
  8640.  
  8641.  
  8642.     ALSO SEE
  8643.         wprintf  wprints  wputns  wputsw  wtabwidth  wtextattr
  8644.  
  8645.     EXAMPLE
  8646.         wputs("\t\033LHello, \033Lworld!\n\n");
  8647.  
  8648.     ------------------------------------------------------------------------
  8649.  
  8650.     NAME
  8651.         wputsw
  8652.  
  8653.     DESCRIPTION
  8654.         Displays a string in active window at the current cursor position.
  8655.         Words will be wrapped around to the next line if necessary.
  8656.         Characters are displayed in the window's current text attribute.
  8657.         Recognizes control characters.  Updates cursor position. Also
  8658.         recognizes CXL Escape sequences.  See Appendix C for a list of valid
  8659.         Escape codes.
  8660.  
  8661.     SYNOPSIS
  8662.         #include "cxlwin.h"
  8663.         int wputsw(char *str);
  8664.  
  8665.     INPUTS
  8666.         str - the address of the string to display
  8667.  
  8668.     RETURN VALUE
  8669.         W_NOERROR  - no error
  8670.         W_NOACTIVE - no active window
  8671.  
  8672.     ALSO SEE
  8673.         wprintf  wputs  wtextattr
  8674.  
  8675.     EXAMPLE
  8676.         wputsw("This is a very long string that will be wrapped around to "
  8677.                "the next line.");
  8678.  
  8679.     ------------------------------------------------------------------------
  8680.  
  8681.     NAME
  8682.         wreadcur
  8683.  
  8684.     DESCRIPTION
  8685.         Reads the current cursor coordinates of the active window.
  8686.  
  8687.     SYNOPSIS
  8688.         #include "cxlwin.h"
  8689.         int wreadcur(int *wrow,int *wcol);
  8690.  
  8691.     INPUTS
  8692.         wrow - address of integer to receive current window row
  8693.         wcol - address of integer to receive current window column
  8694.  
  8695.     RETURN VALUE
  8696.  
  8697.  
  8698.  
  8699.                                      138
  8700.  
  8701.  
  8702.         W_NOERROR  - no error
  8703.         W_NOACTIVE - no active window
  8704.  
  8705.     ALSO SEE
  8706.         wgotoxy
  8707.  
  8708.     EXAMPLE
  8709.         int wrow,wcol;
  8710.         wreadcur(&wrow,&wcol);
  8711.  
  8712.     ------------------------------------------------------------------------
  8713.  
  8714.     NAME
  8715.         wrestore
  8716.  
  8717.     DESCRIPTION
  8718.         Restores a previously saved region of the screen screen and frees
  8719.         the memory allocated by wsave().
  8720.  
  8721.     SYNOPSIS
  8722.         #include "cxlwin.h"
  8723.         void wrestore(int *wbuf);
  8724.  
  8725.     INPUTS
  8726.         wbuf - address of previously wsave()d window.
  8727.  
  8728.     ALSO SEE
  8729.         srestore  wsave
  8730.  
  8731.     ------------------------------------------------------------------------
  8732.  
  8733.     NAME
  8734.         wrjusts
  8735.  
  8736.     DESCRIPTION
  8737.         Displays a string right justified to specified column in the active
  8738.         window.   Does not recognize control characters.  Does not update
  8739.         cursor position.
  8740.  
  8741.     SYNOPSIS
  8742.         #include "cxlwin.h"
  8743.         int wrjusts(int wrow,int wjcol,int attr,char *str);
  8744.  
  8745.     INPUTS
  8746.         wrow  - window row to display string at
  8747.         wjcol - window column that string will right justify to
  8748.         attr  - text attribute for displayed characters
  8749.         str   - address of string to display
  8750.  
  8751.     RETURN VALUE
  8752.         W_NOERROR  - no error
  8753.         W_NOACTIVE - no active window
  8754.         W_INVCOORD - invalid coordinates
  8755.         W_STRLONG  - string too long to fit in window at specified right
  8756.  
  8757.  
  8758.  
  8759.                                      139
  8760.  
  8761.  
  8762.                      justification column.
  8763.  
  8764.     ALSO SEE
  8765.         wcenters  wprints
  8766.  
  8767.     ------------------------------------------------------------------------
  8768.  
  8769.     NAME
  8770.         wsave
  8771.  
  8772.     DESCRIPTION
  8773.         Saves a region of the screen.
  8774.  
  8775.     SYNOPSIS
  8776.         #include "cxlwin.h"
  8777.         int *wsave(int srow,int scol,int erow,int ecol);
  8778.  
  8779.     INPUTS
  8780.         srow - start row
  8781.         scol - start column
  8782.         erow - end row
  8783.         ecol - end column
  8784.  
  8785.     RETURN VALUE
  8786.         Address of newly created window buffer or NULL if a memory
  8787.         allocation error occurred.
  8788.  
  8789.     ALSO SEE
  8790.         ssave  videoinit  wintodisk  wrestore
  8791.  
  8792.     EXAMPLE
  8793.         int *wbuf;
  8794.         if((wbuf=wsave(10,10,20,40))==NULL)
  8795.             printf("Memory allocation error\n");
  8796.  
  8797.     ------------------------------------------------------------------------
  8798.  
  8799.     NAME
  8800.         wscanf
  8801.  
  8802.     DESCRIPTION
  8803.         Inputs a formatted string from keyboard.  Entered characters will
  8804.         echo to the active window in the attribute set by the wtextattr()
  8805.         function. Cursor position will be updated.  Works like the standard
  8806.         C library function scanf() does.  This function is only supported by
  8807.         the Turbo C version of CXL.
  8808.  
  8809.     SYNOPSIS
  8810.         #include "cxlwin.h"
  8811.         int wscanf(const char *format,...);
  8812.  
  8813.     INPUTS
  8814.         format - format string.  Refer to the section on scanf() in Turbo
  8815.                  C's run-time library reference manual.
  8816.  
  8817.  
  8818.  
  8819.                                      140
  8820.  
  8821.  
  8822.         ...    - any additional arguments
  8823.  
  8824.     RETURN VALUE
  8825.         W_NOERROR  - no error
  8826.         W_NOACTIVE - no active window
  8827.  
  8828.     ALSO SEE
  8829.         wgetc  wgetns  wgets  winputsf  wtextattr
  8830.  
  8831.     ------------------------------------------------------------------------
  8832.  
  8833.     NAME
  8834.         wscroll
  8835.  
  8836.     DESCRIPTION
  8837.         Scrolls text lines within the active window, up or down.
  8838.  
  8839.     SYNOPSIS
  8840.         #include "cxlwin.h"
  8841.         int wscroll(int count,int direc);
  8842.  
  8843.     INPUTS
  8844.         count - number of lines to scroll
  8845.         direc - scroll direction:
  8846.                     D_UP   - scroll up
  8847.                     D_DOWN - scroll down
  8848.  
  8849.     RETURN VALUE
  8850.         W_NOERROR  - no error
  8851.         W_NOACTIVE - no active window
  8852.  
  8853.     ALSO SEE
  8854.         wdelline  winsline  wscrollbox
  8855.  
  8856.     ------------------------------------------------------------------------
  8857.  
  8858.     NAME
  8859.         wscrollbox
  8860.  
  8861.     DESCRIPTION
  8862.         Scrolls a region of the active window up or down.
  8863.  
  8864.     SYNOPSIS
  8865.         #include "cxlwin.h"
  8866.         int wscrollbox(int wsrow,int wscol,int werow,int wecol,int count,
  8867.                        int direc);
  8868.  
  8869.     INPUTS
  8870.         wsrow - window start row
  8871.         wscol - window start column
  8872.         werow - window end row
  8873.         wecol - window end column
  8874.         count - number of lines to scroll
  8875.         direc - direction of scroll:
  8876.  
  8877.  
  8878.  
  8879.                                      141
  8880.  
  8881.  
  8882.                     D_UP   -   scroll up
  8883.                     D_DOWN - scroll down
  8884.  
  8885.     RETURN VALUE
  8886.         W_NOERROR  - no error
  8887.         W_NOACTIVE - no active window
  8888.         W_INVCOORD - invalid coordinates
  8889.  
  8890.     ALSO SEE
  8891.         wdelline  winsline  wscroll
  8892.  
  8893.     ------------------------------------------------------------------------
  8894.  
  8895.     NAME
  8896.         wselstr
  8897.  
  8898.     DESCRIPTION
  8899.         Allows user to select one string from an array of strings via an
  8900.         in-place "menu".  Provides Escape checking.
  8901.  
  8902.     SYNOPSIS
  8903.         #include "cxlwin.h"
  8904.         int wselstr(int wrow,int wcol,int attr,char *strarr[],int initelem);
  8905.  
  8906.     INPUTS
  8907.         wrow     - window row to display selections at
  8908.         wcol     - window column to display selections at
  8909.         attr     - attribute for selection text
  8910.         strarr   - the array of string (char *) pointers which to pick from.
  8911.                    The last pointer in the array MUST be NULL!
  8912.         initelem - element of string to initialize selection bar to.  If
  8913.                    given element is invalid, it will default to 0.
  8914.  
  8915.     RETURN VALUE
  8916.         The array subscript of the string which was selected.  If an error
  8917.         occurred, then -1 will be returned and _winfo.errno will be set to
  8918.         one of the following:
  8919.             W_NOACTIVE - no active window
  8920.             W_ESCPRESS - [Esc] key was pressed (if Escape checking was on)
  8921.  
  8922.     ALSO SEE
  8923.         wpickstr  wsetesc
  8924.  
  8925.     EXAMPLE
  8926.         int i;
  8927.         char *prn_ports[]= { "PRN","LPT1","LPT2","COM1","COM2",NULL };
  8928.         wprints(0,0,LCYAN|_BLUE,"Select printer:");
  8929.         i=wselstr(0,16,LMAGENTA|_BLUE,prn_ports,0);
  8930.         if(i!=-1) wprintf("You selected %s\n",prn_ports[i]);
  8931.  
  8932.     ------------------------------------------------------------------------
  8933.  
  8934.     NAME
  8935.         wsetesc
  8936.  
  8937.  
  8938.  
  8939.                                      142
  8940.  
  8941.  
  8942.     DESCRIPTION
  8943.         Sets the Escape checking status for window keyboard input functions
  8944.         that utilize Escape checking.  By default, Escape checking is on.
  8945.         When the user presses [Esc] while Escape checking is off, the
  8946.         keypress will be ignored.  The exception to this is when inside a
  8947.         context-sensitive help screen or when inside a sub-menu of a
  8948.         multi-level menu system.
  8949.  
  8950.     SYNOPSIS
  8951.         #include "cxlwin.h"
  8952.         void wsetesc(int option);
  8953.  
  8954.     INPUTS
  8955.         option - 0 = turn Escape checking off, 1 = turn Escape checking on
  8956.  
  8957.     ALSO SEE
  8958.         wgetchf  wgetns  winpread  winputsf  wmenuget  wpickfile  wpickstr
  8959.  
  8960.     ------------------------------------------------------------------------
  8961.  
  8962.     NAME
  8963.         wshadoff
  8964.  
  8965.     DESCRIPTION
  8966.         Removes the shadow from the active window, if one exists.  This
  8967.         function is only needed when you want to prematurely remove the
  8968.         active window's shadow.  The wclose() function automatically calls
  8969.         wshadoff() when it closes a window.
  8970.  
  8971.     SYNOPSIS
  8972.         #include "cxlwin.h"
  8973.         int wshadoff(void);
  8974.  
  8975.     RETURN VALUE
  8976.         W_NOERROR  - no error
  8977.         W_NOACTIVE - no active window
  8978.  
  8979.     ALSO SEE
  8980.         wclose  wshadow
  8981.  
  8982.     ------------------------------------------------------------------------
  8983.  
  8984.     NAME
  8985.         wshadow
  8986.  
  8987.     DESCRIPTION
  8988.         Gives the active window a shadow.  The shadow will be cast to the
  8989.         right of the window and will be translucent (the characters
  8990.         underneath the shadow will show through in the given attribute).
  8991.  
  8992.     SYNOPSIS
  8993.         #include "cxlwin.h"
  8994.         int wshadow(int attr);
  8995.  
  8996.  
  8997.  
  8998.  
  8999.                                      143
  9000.  
  9001.  
  9002.     INPUTS
  9003.         attr - attribute to use for the shadow and the characters underneath
  9004.                it. The most realistic looking shadow will be achieved using
  9005.                DGREY|_BLACK, but depending upon the contrast setting on your
  9006.                monitor, underlying characters may not be visible.  Several
  9007.                commercial programs use a shadow attribute of LGREY|_BLACK
  9008.                for this reason.
  9009.  
  9010.     RETURN VALUE
  9011.         W_NOERROR  - no error
  9012.         W_NOACTIVE - no active window
  9013.         W_ALLOCERR - memory allocation error
  9014.  
  9015.     ALSO SEE
  9016.         wshadoff
  9017.  
  9018.     EXAMPLE
  9019.         wshadow(DGREY|_BLACK);
  9020.  
  9021.     ------------------------------------------------------------------------
  9022.  
  9023.     NAME
  9024.         wsize
  9025.  
  9026.     DESCRIPTION
  9027.         Adjusts the size of the active window by changing the screen
  9028.         coordinates of its lower-right corner.
  9029.  
  9030.     SYNOPSIS
  9031.         #include "cxlwin.h"
  9032.         int wsize(int nerow,int necol);
  9033.  
  9034.     INPUTS
  9035.         nerow - new end row of window
  9036.         necol - new end column of window
  9037.  
  9038.     RETURN VALUE
  9039.         W_NOERROR  - no error
  9040.         W_ALLOCERR - memory allocation error
  9041.         W_NOACTIVE - no active window
  9042.         W_INVCOORD - invalid coordinates
  9043.  
  9044.     ALSO SEE
  9045.         wcopy  wmove
  9046.  
  9047.     ------------------------------------------------------------------------
  9048.  
  9049.     NAME
  9050.         wslide
  9051.  
  9052.     DESCRIPTION
  9053.         Smoothly slides active window to new screen position.
  9054.  
  9055.     SYNOPSIS
  9056.  
  9057.  
  9058.  
  9059.                                      144
  9060.  
  9061.  
  9062.         #include "cxlwin.h"
  9063.         int wslide(int nsrow,int nscol);
  9064.  
  9065.     INPUTS
  9066.         nsrow - new start row for window
  9067.         nscol - new start column for window
  9068.  
  9069.     RETURN VALUE
  9070.         W_NOERROR  - no error
  9071.         W_NOACTIVE - no active window
  9072.         W_INVCOORD - invalid coordinates
  9073.         W_ALLOCERR - memory allocation error
  9074.  
  9075.     ALSO SEE
  9076.         wdrag  wmove
  9077.  
  9078.     ------------------------------------------------------------------------
  9079.  
  9080.     NAME
  9081.         wtabwidth
  9082.  
  9083.     DESCRIPTION
  9084.         Modifies the tab width to be used when displaying tabs in the active
  9085.         window via the window TTY output functions.  The default tab width
  9086.         is 8.
  9087.  
  9088.     SYNOPSIS
  9089.         #include "cxlwin.h"
  9090.         void wtabwidth(int tabwidth);
  9091.  
  9092.     INPUTS
  9093.         tabwidth - the new tab width
  9094.  
  9095.     EXAMPLE
  9096.         wputs("\n\tHello, world");
  9097.         wtabwidth(4);
  9098.         wputs("\n\tHello, world");
  9099.  
  9100.     ------------------------------------------------------------------------
  9101.  
  9102.     NAME
  9103.         wtextattr
  9104.  
  9105.     DESCRIPTION
  9106.         Sets the current text attribute for the active window.  The current
  9107.         text attribute is used by the window TTY output functions for
  9108.         displaying text inside the active window.
  9109.  
  9110.     SYNOPSIS
  9111.         #include "cxlwin.h"
  9112.         int wtextattr(int attr);
  9113.  
  9114.     INPUTS
  9115.         attr - the new text attribute
  9116.  
  9117.  
  9118.  
  9119.                                      145
  9120.  
  9121.  
  9122.     RETURN VALUE
  9123.         W_NOERROR  - no error
  9124.         W_NOACTIVE - no active window
  9125.  
  9126.     ALSO SEE
  9127.         attrib  wchgattr
  9128.  
  9129.     EXAMPLE
  9130.         wtextattr(LCYAN|_GREEN|BLINK);
  9131.         wputs("Hello, world\n");
  9132.  
  9133.     ------------------------------------------------------------------------
  9134.  
  9135.     NAME
  9136.         wtitle
  9137.  
  9138.     DESCRIPTION
  9139.         Gives active window a title and displays title on top border line of
  9140.         window.  If active window has no border, then the window's record
  9141.         will be updated, but no title will be visible.
  9142.  
  9143.     SYNOPSIS
  9144.         #include "cxlwin.h"
  9145.         int wtitle(char *str,int tpos,int tattr);
  9146.  
  9147.     INPUTS
  9148.         str   - address of title string or NULL to delete title
  9149.         tpos  - title position.  If str==NULL then tpos is ignored.  Valid
  9150.                 tpos values are:
  9151.                     TLEFT   - left justified
  9152.                     TCENTER - centered
  9153.                     TRIGHT  - right justified
  9154.         tattr - attribute of window's title
  9155.  
  9156.     RETURN VALUE
  9157.         W_NOERROR  - no error
  9158.         W_NOACTIVE - no active window
  9159.         W_ALLOCERR - memory allocation error
  9160.  
  9161.     ALSO SEE
  9162.         wmessage
  9163.  
  9164.     EXAMPLE
  9165.         wtitle("[ My Window ]",TCENTER,YELLOW|_BROWN);
  9166.  
  9167.     ------------------------------------------------------------------------
  9168.  
  9169.     NAME
  9170.         wunhide
  9171.  
  9172.     DESCRIPTION
  9173.         Unhides a previously hidden window.  The unhidden window becomes the
  9174.         active window.
  9175.  
  9176.  
  9177.  
  9178.  
  9179.                                      146
  9180.  
  9181.  
  9182.     SYNOPSIS
  9183.         #include "cxlwin.h"
  9184.         int wunhide(WINDOW whandle);
  9185.  
  9186.     INPUTS
  9187.         whandle - the handle of the window to unhide.  If you want to unhide
  9188.                   the most recently hidden window, then specify 0.
  9189.  
  9190.     RETURN VALUE
  9191.         W_NOERROR  - no error
  9192.         W_ALLOCERR - memory allocation error
  9193.         W_NOTFOUND - window handle not found
  9194.         W_NOHIDDEN - no hidden windows
  9195.         W_NOTHIDD  - window not hidden
  9196.  
  9197.     ALSO SEE
  9198.         whide
  9199.  
  9200.     ------------------------------------------------------------------------
  9201.  
  9202.     NAME
  9203.         wunlink
  9204.  
  9205.     DESCRIPTION
  9206.         Releases all memory allocated by a window, then unlinks it from the
  9207.         window chain, making it no longer accessible.  The screen is not
  9208.         changed in any way.
  9209.  
  9210.     SYNOPSIS
  9211.         #include "cxlwin.h"
  9212.         int wunlink(WINDOW w);
  9213.  
  9214.     INPUTS
  9215.         w - handle of the window to unlink
  9216.  
  9217.     RETURN VALUE
  9218.         W_NOERROR  - no error
  9219.         W_NOTFOUND - input window handle was not found
  9220.  
  9221.     ALSO SEE
  9222.         wclose
  9223.  
  9224.     ------------------------------------------------------------------------
  9225.  
  9226.     NAME
  9227.         wvline
  9228.  
  9229.     DESCRIPTION
  9230.         "Draws" a vertical text line in the active window using characters
  9231.         defined by the given box type.  If the vertical line crosses a
  9232.         horizontal line of the same box type, an appropriate intersection or
  9233.         corner will be displayed.
  9234.  
  9235.     SYNOPSIS
  9236.  
  9237.  
  9238.  
  9239.                                      147
  9240.  
  9241.  
  9242.         #include "cxlwin.h"
  9243.         int wvline(int wsrow,int wscol,int count,int btype,int attr);
  9244.  
  9245.     INPUTS
  9246.         wsrow - window start row
  9247.         wscol - window start column
  9248.         count - number of line characters to display
  9249.         btype - box type.  Can be one of the following:
  9250.                     0 - single line
  9251.                     1 - double line
  9252.                     2 - single horz, double vert line
  9253.                     3 - double horz, single vert line
  9254.                     4 - thick line
  9255.                     5 - uses spaces for line characters
  9256.         attr  - attribute to use for text line
  9257.  
  9258.     RETURN VALUE
  9259.         W_NOERROR  - no error
  9260.         W_NOACTIVE - no active window
  9261.         W_INVCOORD - entire text line could not fit in window
  9262.         W_INVBTYPE - invalid box type
  9263.  
  9264.     ALSO SEE
  9265.         whline
  9266.  
  9267.     ------------------------------------------------------------------------
  9268.  
  9269.     NAME
  9270.         wwprints
  9271.  
  9272.     DESCRIPTION
  9273.         Prints a string to the specified window.  The specified window can
  9274.         be active, hidden, or blocked.  Control characters are not
  9275.         recognized. Cursor position is not updated.
  9276.  
  9277.     SYNOPSIS
  9278.         #include "cxlwin.h"
  9279.         int wwprints(WINDOW whandle,int wrow,int wcol,int attr,char *str);
  9280.  
  9281.     INPUTS
  9282.         whandle - handle of window to display to
  9283.         wrow    - window row to write string to
  9284.         wcol    - window column to write string to
  9285.         attr    - text attribute for written characters
  9286.         str     - address of string to display
  9287.  
  9288.     RETURN VALUE
  9289.         W_NOERROR  - no error
  9290.         W_NOACTIVE - no active window
  9291.         W_NOTFOUND - window handle not found
  9292.         W_INVCOORD - invalid window coordinates
  9293.         W_STRLONG  - string too long (not all of string was displayed)
  9294.  
  9295.     ALSO SEE
  9296.  
  9297.  
  9298.  
  9299.                                      148
  9300.  
  9301.  
  9302.         wprints
  9303.  
  9304.  
  9305.  
  9306.  
  9307.  
  9308.  
  9309.  
  9310.  
  9311.  
  9312.  
  9313.  
  9314.  
  9315.  
  9316.  
  9317.  
  9318.  
  9319.  
  9320.  
  9321.  
  9322.  
  9323.  
  9324.  
  9325.  
  9326.  
  9327.  
  9328.  
  9329.  
  9330.  
  9331.  
  9332.  
  9333.  
  9334.  
  9335.  
  9336.  
  9337.  
  9338.  
  9339.  
  9340.  
  9341.  
  9342.  
  9343.  
  9344.  
  9345.  
  9346.  
  9347.  
  9348.  
  9349.  
  9350.  
  9351.  
  9352.  
  9353.  
  9354.  
  9355.  
  9356.  
  9357.  
  9358.  
  9359.                                      149
  9360.  
  9361.  
  9362.     Appendix A - Text Attribute Identifiers
  9363.  
  9364.  
  9365.          Foreground Colors                   Background Colors
  9366.  
  9367.         Identifier    Color                  Identifier    Color
  9368.         ----------    -----                  ----------    -----
  9369.         BLACK       - black                  _BLACK       - black
  9370.         BLUE        - blue                   _BLUE        - blue
  9371.         GREEN       - green                  _GREEN       - green
  9372.         CYAN        - cyan                   _CYAN        - cyan
  9373.         RED         - red                    _RED         - red
  9374.         MAGENTA     - magenta                _MAGENTA     - magenta
  9375.         BROWN       - brown                  _BROWN       - brown
  9376.         LGREY       - light grey             _LGREY       - light grey
  9377.         DGREY       - dark grey
  9378.         LBLUE       - light blue
  9379.         LGREEN      - light green
  9380.         LCYAN       - light cyan
  9381.         LRED        - light red
  9382.         LMAGENTA    - light magenta
  9383.         YELLOW      - yellow
  9384.         WHITE       - white
  9385.  
  9386.         BLINK       - blinking foreground
  9387.  
  9388.  
  9389.     Example Usage:
  9390.  
  9391.         BLINK|WHITE|_RED    -   blinking white on red
  9392.         YELLOW|_BLUE        -   yellow on blue
  9393.         LMAGENTA            -   light magenta on black
  9394.         _BLUE               -   black on blue
  9395.  
  9396.  
  9397.  
  9398.  
  9399.  
  9400.  
  9401.  
  9402.  
  9403.  
  9404.  
  9405.  
  9406.  
  9407.  
  9408.  
  9409.  
  9410.  
  9411.  
  9412.  
  9413.  
  9414.  
  9415.  
  9416.  
  9417.  
  9418.  
  9419.                                      150
  9420.  
  9421.  
  9422.     Appendix B - Keycode Table
  9423.  
  9424.  
  9425.     Key             Norm        Shift       Ctrl        Alt
  9426.     ----            ----        -----       ----        ---
  9427.     A               1E61        1E41        1E01        1E00
  9428.     B               3062        3042        3002        3000
  9429.     C               2E63        2E42        2E03        2E00
  9430.     D               2064        2044        2004        2000
  9431.     E               1265        1245        1205        1200
  9432.     F               2166        2146        2106        2100
  9433.     G               2267        2247        2207        2200
  9434.     H               2368        2348        2308        2300
  9435.     I               1769        1749        1709        1700
  9436.     J               246A        244A        240A        2400
  9437.     K               256B        254B        250B        2500
  9438.     L               266C        264C        260C        2600
  9439.     M               326D        324D        320D        3200
  9440.     N               316E        314E        310E        3100
  9441.     O               186F        184F        180F        1800
  9442.     P               1970        1950        1910        1900
  9443.     Q               1071        1051        1011        1000
  9444.     R               1372        1352        1312        1300
  9445.     S               1F73        1F53        1F13        1F00
  9446.     T               1474        1454        1414        1400
  9447.     U               1675        1655        1615        1600
  9448.     V               2F76        2F56        2F16        2F00
  9449.     W               1177        1157        1117        1100
  9450.     X               2D78        2D58        2D18        2D00
  9451.     Y               1579        1559        1519        1500
  9452.     Z               2C7A        2C5A        2C1A        2C00
  9453.     1               0231        0221        N/A         7800
  9454.     2               0332        0340        0300        7900
  9455.     3               0433        0423        N/A         7A00
  9456.     4               0534        0524        N/A         7B00
  9457.     5               0635        0625        N/A         7C00
  9458.     6               0736        075E        071E        7D00
  9459.     7               0837        0826        N/A         7E00
  9460.     8               0938        092A        N/A         7F00
  9461.     9               0A39        0A28        N/A         8000
  9462.     0               0B30        0B29        N/A         8100
  9463.     ,               332C        333C        N/A         N/A
  9464.     .               342E        343E        N/A         N/A
  9465.     /               352F        353F        N/A         N/A
  9466.     ;               273B        273A        N/A         N/A
  9467.     '               2827        2822        N/A         N/A
  9468.     [               1A5B        1A7B        1A1B        N/A
  9469.     ]               1B5D        1B7D        1B1D        N/A
  9470.     `               2960        297E        N/A         N/A
  9471.     -               0C2D        0C5F        0C1F        8200
  9472.     =               0D3D        0D2B        N/A         8300
  9473.     \               2B5C        2B7C        2B1C        N/A
  9474.  
  9475.  
  9476.  
  9477.  
  9478.  
  9479.                                      151
  9480.  
  9481.  
  9482.     Key             Norm        Shift       Ctrl        Alt
  9483.     ----            ----        -----       ----        ---
  9484.     F1              3B00        5400        5E00        6800
  9485.     F2              3C00        5500        5F00        6900
  9486.     F3              3D00        5600        6000        6A00
  9487.     F4              3E00        5700        6100        6B00
  9488.     F5              3F00        5800        6200        6C00
  9489.     F6              4000        5900        6300        6D00
  9490.     F7              4100        5A00        6400        6E00
  9491.     F8              4200        5B00        6500        6F00
  9492.     F9              4300        5C00        6600        7000
  9493.     F10             4400        5D00        6700        7100
  9494.     Enter           1C0D        1C0D        1C0A        N/A
  9495.     Ins             5200        5230        N/A         N/A
  9496.     Del             5300        532E        N/A         N/A
  9497.     Esc             011B        011B        011B        N/A
  9498.     Home            4700        4737        7700        N/A
  9499.     End             4F00        4F31        7500        N/A
  9500.     PgUp            4900        4939        8400        N/A
  9501.     PgDn            5100        5133        7600        N/A
  9502.     <Tab>           0F09        0F00        N/A         N/A
  9503.     <BackSpace>     0E08        0E08        0E7F        N/A
  9504.     <LeftArrow>     4B00        4B34        7300        N/A
  9505.     <RightArrow>    4D00        4D36        7400        N/A
  9506.     <UpArrow>       4800        4838        N/A         N/A
  9507.     <DownArrow>     5000        5032        N/A         N/A
  9508.     <Keypad 5>      N/A         4C35        N/A         N/A
  9509.     <Grey *>        372A        N/A         7200        N/A
  9510.     <Grey ->        4A2D        4A2D        N/A         N/A
  9511.     <Grey +>        4E2B        4E2B        N/A         N/A
  9512.  
  9513.  
  9514.  
  9515.  
  9516.  
  9517.  
  9518.  
  9519.  
  9520.  
  9521.  
  9522.  
  9523.  
  9524.  
  9525.  
  9526.  
  9527.  
  9528.  
  9529.  
  9530.  
  9531.  
  9532.  
  9533.  
  9534.  
  9535.  
  9536.  
  9537.  
  9538.  
  9539.                                      152
  9540.  
  9541.  
  9542.     Appendix C - Window Output Escape Codes
  9543.  
  9544.  
  9545.     Escape Code         Function
  9546.     -----------         --------
  9547.         +           -   increase text attribute
  9548.         -           -   decrease text attribute
  9549.         A?          -   set text attribute to ?
  9550.         F?          -   set foreground text attribute to ?
  9551.         B?          -   set background text attribute to ?
  9552.         I           -   toggle intensity
  9553.         L           -   toggle blink
  9554.         X           -   reverse text attribute
  9555.         R?          -   set window row coordinate to ?
  9556.         C?          -   set window column coordinate to ?
  9557.         E?          -   erase ?:
  9558.                             W - entire window, home cursor
  9559.                             L - to end-of-line
  9560.                             S - to end-of-window
  9561.         D??         -   display ? character ? times
  9562.  
  9563.  
  9564.     Window output Escape codes are only available in the window TTY output
  9565.     string functions.  Valid functions are wprintf(), wputs(), wputsw(), and
  9566.     others.  Also, the text inside help files can contain Escape codes
  9567.     (excluding cross-reference items).  The Escape code parameters MUST be
  9568.     character (byte) size.  Parameters should be input as binary.  For
  9569.     example, 5 would be '\005'.  If you are using them from inside a
  9570.     wprintf() format string, you can use the '%c' format specifier to supply
  9571.     the parameter from the list of variables.
  9572.  
  9573.     Example Usage:
  9574.  
  9575.         wprintf("\033A%cNormal \033IBright\033I \033LBlink\033L"
  9576.                 " \033XReverse\033X\n",CYAN|_BLUE);
  9577.         wprintf("\033R%c\033C%cRow %d, Col %d\n",3,5,3,5);
  9578.         wputs("\033DA\014 = 'A' 12 times\n");
  9579.  
  9580.  
  9581.  
  9582.  
  9583.  
  9584.  
  9585.  
  9586.  
  9587.  
  9588.  
  9589.  
  9590.  
  9591.  
  9592.  
  9593.  
  9594.  
  9595.  
  9596.  
  9597.  
  9598.  
  9599.                                      153
  9600.  
  9601.  
  9602.     Appendix D - Format Control Characters
  9603.  
  9604.      FCC                Description
  9605.      ---                -----------
  9606.       #         Allows numeric characters '0' thru '9'.
  9607.       %         Allows numeric characters '0' thru '9' and ' '.
  9608.       9         Allows numeric characters '0' thru '9', '.', '-', and '+'.
  9609.       ?         Allows any character.
  9610.       *         Allows any printable character.
  9611.       A         Allows alpha characters 'A' thru 'Z', 'a' thru 'z', and ' '.
  9612.       D         Allows date characters '0' thru '9', '-', and '/'.
  9613.       F         Allows legal MS-DOS filename characters.
  9614.       H         Allows hexadecimal characters '0' thru '9', 'A' thru 'F',
  9615.                 and 'a' thru 'f'.
  9616.       L         Allows alpha characters 'A' thru 'Z', 'a' thru 'z', and ' '.
  9617.                 Input letters will be converted to lowercase.
  9618.       M         Allows alpha characters 'A' thru 'Z', 'a' thru 'z', and ' '.
  9619.                 Input letters will be converted to mixed case
  9620.       P         Allows alpha characters 'A' thru 'Z', 'a' thru 'z', and ' '.
  9621.                 Input letters will be displayed as spaces, which is useful
  9622.                 for entering passwords.
  9623.       T         Allows telephone number characters '0' thru '9', '(', ')',
  9624.                 '-', and ' '.
  9625.       U         Allows alpha characters 'A' thru 'Z', 'a' thru 'z', and ' '.
  9626.                 Input letters will be converted to uppercase.
  9627.       W         Allows legal MS-DOS filename characters, including
  9628.                 wildcards.
  9629.       X         Allows alphanumeric characters 'A' thru 'Z', 'a' thru 'z',
  9630.                 '0' thru '9', and ' '.
  9631.       Y         Allows yes/no response characters 'Y', 'N', 'y', and 'n'.
  9632.  
  9633.       (space)   Space characters can be used throughout a format string to
  9634.                 improve its readability.
  9635.  
  9636.       <         Start of inclusion set.  An inclusion set allows you to
  9637.                 specify the only allowable characters for a position.
  9638.  
  9639.       >         End of inclusion set.  Any characters listed between the
  9640.                 left and right angle brackets are part of the set.
  9641.  
  9642.       [         Start of exclusion set.  An exclusion set allows you to
  9643.                 specify characters that aren't allowed in that position.
  9644.  
  9645.       ]         End of exclusion set.  Any characters listed between the
  9646.                 left and right square brackets are part of the set.
  9647.  
  9648.       '         Start or end of quoted text that will be displayed either in
  9649.                 the input field or as you are typing.  All characters in
  9650.                 between the start and end quotes will be displayed as text.
  9651.  
  9652.       "         Same as the single quote.  Is useful if you need to actually
  9653.                 display a single quote as text.  Note that in C, you must
  9654.                 represent the double quote as:  \"
  9655.  
  9656.  
  9657.  
  9658.  
  9659.                                      154
  9660.  
  9661.  
  9662.       !         Start and stop a command toggle sequence.  Any characters
  9663.                 in between the start and stop exclamation points are treated
  9664.                 as command toggles.  You can have as many command toggles
  9665.                 as you like between the exclamation points.  Valid command
  9666.                 toggles are listed below.  Command Toggles are valid with
  9667.                 inputsf() and winputsf() only!
  9668.  
  9669.     Command
  9670.     Toggle                    Description
  9671.     -------                   -----------
  9672.       -         Decreases text attribute.  Valid with winputsf() only.
  9673.       +         Increases text attribute.  Valid with winputsf() only.
  9674.       C         Toggles copying of quoted characters to receiving buffer.
  9675.                 The default is off.
  9676.       E         Toggles Escape checking.  When on, if [Esc] is pressed, the
  9677.                 receiving buffer will be emptied and an error code will be
  9678.                 returned.  The default for inputsf() is on. The default for
  9679.                 winputsf() is the value of the global variable _winfo.esc.
  9680.       L         Toggles lower-case conversion.  When on, all input letters
  9681.                 will be forced to lower-case.  The default is off.
  9682.       M         Toggles mixed-case conversion.  When on, input letters will
  9683.                 be forced to upper-case for the first letter of each word
  9684.                 and lower-case for the remaining letters.  The default is
  9685.                 off.
  9686.       P         Toggles password mode.  When on, input characters will be
  9687.                 echoed to the screen as spaces.  This is useful for password
  9688.                 fields.  The default is off.
  9689.       R         Toggles Return checking.  When off, if [Enter] is pressed,
  9690.                 it will be ignored.  This is useful for forcing the user's
  9691.                 input.  Default is on.
  9692.       U         Toggles upper-case conversion.  When on, input letters will
  9693.                 be forced to upper-case.  The default is off.
  9694.  
  9695.     Examples:
  9696.  
  9697.     inputsf(name,"'Enter name:  ' !UR! XXXXX !R! XXXXXXXXXX");
  9698.  
  9699.     Prompts for name, inputs string from keyboard converting characters to
  9700.     uppercase as it goes, allows up to 15 alphanumeric characters as input.
  9701.     The return key is disabled until at least 5 characters have been
  9702.     entered.  Input characters will be copied to the receiving buffer, name,
  9703.     which must be large enough to hold all 16 characters - 15 for the input
  9704.     string, and one for the terminating '\0'.
  9705.  
  9706.  
  9707.     winputsf(phone," 'Enter phone:  '!RC! '(' ### ') ' ### '-' ####");
  9708.  
  9709.     Prompts for a full phone number including area code, allows only digit
  9710.     characters and displays format punctuation as it goes.  The entire field
  9711.     must be filled before return can be pressed.  All of the characters
  9712.     except the prompt will be copied to the receiving buffer, phone.  This
  9713.     buffer must be large enough to hold 15 characters - 10 for the phone
  9714.     number digits, 4 for the copied punctuation characters, and 1 for the
  9715.     terminating '\0'.
  9716.  
  9717.  
  9718.  
  9719.                                      155
  9720.  
  9721.  
  9722.     winpdef( 1,16,date,"<01>#'/'<0123>#'/'<89>#",0,0,NULL,0);
  9723.  
  9724.     Defines an input field that will accept a MMDDYY date.  Note the use of
  9725.     the inclusion set '<' and '>' characters to aid in allowing only valid
  9726.     numbers.  The receiving buffer, date, must be at least 7 characters to
  9727.     hold the 6 date characters and the terminating '\0'.
  9728.  
  9729.  
  9730.  
  9731.  
  9732.  
  9733.  
  9734.  
  9735.  
  9736.  
  9737.  
  9738.  
  9739.  
  9740.  
  9741.  
  9742.  
  9743.  
  9744.  
  9745.  
  9746.  
  9747.  
  9748.  
  9749.  
  9750.  
  9751.  
  9752.  
  9753.  
  9754.  
  9755.  
  9756.  
  9757.  
  9758.  
  9759.  
  9760.  
  9761.  
  9762.  
  9763.  
  9764.  
  9765.  
  9766.  
  9767.  
  9768.  
  9769.  
  9770.  
  9771.  
  9772.  
  9773.  
  9774.  
  9775.  
  9776.  
  9777.  
  9778.  
  9779.                                      156
  9780.  
  9781.  
  9782.     Appendix E - Input Field Editing Keys
  9783.  
  9784.  
  9785.           Key                  Action
  9786.           ---                  ------
  9787.         LeftArrow             cursor left
  9788.         RightArrow            cursor right
  9789.         UpArrow               cursor up
  9790.         DownArrow             cursor down
  9791.         Ctrl-LeftArrow        word left
  9792.         Ctrl-RightArrow       word right
  9793.         Tab                   field right
  9794.         Shift-Tab             field left
  9795.         Enter                 process field
  9796.         Ctrl-Enter            process all fields
  9797.         Decimal (.)           move to right side of decimal point
  9798.         Home                  beginning of field
  9799.         End                   end of field line / end of field
  9800.         Ctrl-Home             beginning of first field
  9801.         Ctrl-End              end of last field
  9802.         Ins                   toggle field insert mode
  9803.         Del                   delete character at cursor
  9804.         BackSpace             delete character left
  9805.         Ctrl-BackSpace        delete word left
  9806.         Ctrl-R                restore field to original contents
  9807.         Ctrl-T                delete word right
  9808.         Ctrl-U                delete to end of field
  9809.         Ctrl-Y                delete to end of last field
  9810.         Esc                   abort data entry (if Escape checking is on)
  9811.  
  9812.  
  9813.  
  9814.  
  9815.  
  9816.  
  9817.  
  9818.  
  9819.  
  9820.  
  9821.  
  9822.  
  9823.  
  9824.  
  9825.  
  9826.  
  9827.  
  9828.  
  9829.  
  9830.  
  9831.  
  9832.  
  9833.  
  9834.  
  9835.  
  9836.                                      157
  9837.